Leaderboard
Popular Content
Showing content with the highest reputation on 11/09/2016 in all areas
-
Just pushed some updates to this ancient module. The new version (v1.2.0) uses wireMail and should work with PW 3.5 points
-
Perhaps this small snippet for site/ready.php could be also sufficient (it prepends a dot to the directory name for pages with a given template): <?php wire()->addHookAfter("PagefilesManager::path", null, "protectedpath"); function protectedpath(HookEvent $event) { $page = $event->object->page; if($page->template == 'specialpath') { $event->return = preg_replace('~(\d+/?)$~', '.$1', $event->return); } }5 points
-
Is is possible to hook on file added and place a htacces in it when not already exists? or do I misunderstood your question alltogether... file_put_contents('/path/to/the/specific/assets/folder/.htaccess', "<Files *.*>\n\tdeny from all\n</Files>\n");5 points
-
I guess you have already tried clearing the cache. What modules is the site using?5 points
-
4 points
-
I have always been a huge fan of the vector shape side of SVG, but I have never really experimented with all its other abilities. Here's an interesting article on some of the other things it can do: http://go.sitepoint.com/t/ViewEmail/y/28B66532868053D2/93084645AE7B31BD981D23A7722F2DCD Just pinging @horst because it may be of particular interest to him3 points
-
Thanks @adrian great to see it back! It looks like you know Wikipedia much better than me, would you be able to help maintain the page for ProcessWire going forward too?3 points
-
v100 is up with the recent fixes/suggestions/requests: moved AdminLangSwitcher, noAnim, HoverDropdown, LangTabHotkeySwitcher, AdminColumns, AutosizeTextareas, TabIndex submodules into Misc submodule moved PageListUnselect submodule into PageListTweaks submodule added e.metaKey besides e.ctrlKey (suggested by adrian) separate CSS/JS for AOS configuration page (suggested by matjazp) do not load module CSS/JS when module is disabled flatModules: make "Add new module" section visible when clicking on "Add new" from sidebar/top menu (reported by adrian) force loading of longclick.js for moduleModal (reported by gmclelland) fix for invisible AsmList items on drag (reported by adrian) added hash navigation for module config page I moved non-configurable submodules into other submodules (mostly into Misc). You'll need to re-set them if you used them before. Hash navigation is not exactly working as expected so it may be removed later.2 points
-
Hey @tpr - would you mind changing Hotkeys.js instances of: e.ctrlKey to: (e.metaKey || e.ctrlKey) so it's more intuitive for Mac users. Thanks!2 points
-
Big thanks for you. I modified your code because I didn't want to fetch images for downloading but just for linking. I made a new template 'kuvat' (means photos) with fields for Flickr gallery id and image field for main page listing. Only bad thing is that user have to add each gallery separately. But works pretty well and better urls than what we had on Drupal. I use smaller thumbnails (q is 150 x 150) for faster loading and Photobox effect for normal photos. <?php include "../lib/curl.class.php"; include "../lib/flickr_album_utils.php"; $album = fa_get_album($item); $images = array(); foreach($album["all_images"] as $f) { $photo = 'https://farm'.$f["farm"].'.staticflickr.com/'.$f["server"].'/'.$f["id"].'_'.$f["secret"].'_b.jpg'; $thumb = 'https://farm'.$f["farm"].'.staticflickr.com/'.$f["server"].'/'.$f["id"].'_'.$f["secret"].'_q.jpg'; echo "<a class='event' href='$photo'><img src='$thumb' alt=''/>"; } ?>2 points
-
Either that or test-drive the upgrade on a local development system. Which, of course, doesn't substitute for having a working full backup of the live site at hand any time you make changes there, but it should rule out issues with older modules (few as they are).2 points
-
haha - in reality it was Google that knew it better than you But I am happy to help maintain it. It might be nice if we have one person assigned to updating the latest stable version / release date info on the list of CMS's just so that a bunch of us don't go looking every week (or whenever you push dev to master which is pretty often these days) to see if it's already been done. I can put it in my calendar to take care of this.2 points
-
all very useful snippets and hints! My current question was simply how the apache directives are that block access, and work in any Apache version (2.2, 2.4) I thought there were a need for different terms, depending on the apache version. But now, after reading @Martijn Geerts example (Thanks!), I saw that the Files-directive is also available in Apache 2.4. (unchanged as it was in 2.2 and also 2.0 and 1.3, and ...). So, thank you all for your help and tipps. This solved my question! @BitPoet: this one is very handy too. I bookmarked it for later, other use cases. Thanks!2 points
-
@horst That's great! Thanks @arjen! The more people we have working on it I think the better. I think part of the issue before was just that I created the page 5 years ago and had been the only one making updates to it, and likewise only one that crosslinked it to the CMS and CMF list pages on Wikipedia. I'm guessing this flags it somehow, as Wikipedia likes to see more community involvement (which makes sense). Since I'm still the person that originally created the page, I think it's also best that I'm not the one that adds it on other sections in Wikipedia. If any of you guys thinks that ProcessWire belongs on the Wikipedia CMS and CMF lists, would you consider adding ProcessWire to these pages below? List of content management systems: https://en.wikipedia.org/wiki/List_of_content_management_systems List of content management frameworks: https://en.wikipedia.org/wiki/List_of_content_management_frameworks2 points
-
That did the trick sir i Cleared the cache and now everything fall into place How embarassing sorry for this.2 points
-
@Nukro 1. List view: Yes, that's on my todo list right here 2. I need to dispense with version 7 first. Then I will look into if/how I can integrate custom filters2 points
-
Bit of a longshot, but any chance the 2016 page is not activated for "fr" ? I get the same result as you if I uncheck the "active" checkbox on the settings tab.2 points
-
To test it you'd need to set the inputfield to Hidden, create a new page, then check the value as described above. If it's an existing page that was previously edited when the field was set to Open or Closed (i.e. anything that actually rendered the inputfield) then the value will remain populated even after you change the inputfield to Hidden. That's because changing the inputfield to hidden wouldn't delete field data from the DB.2 points
-
1. You can get the field value with $page->my_datetime and log it, dump it with Tracy Debugger, or echo it on the frontend. 2. You can check the database table for the field in PhpMyAdmin or similar.2 points
-
All sorted - I published it which actually requires: More > Move https://en.wikipedia.org/wiki/ProcessWire2 points
-
New master and dev versions released, more coverage of what you can do with the new Functions API, plus a couple useful tips and tricks. https://processwire.com/blog/posts/processwire-3.0.40-core-updates/1 point
-
Hello @microcipcip, I believe Ryan meant any change of the files. It is not recommended to track assets or uploads folders, because they can easily bloat your commit history and even worse you could grow a repository over 1 GB. Tracking the database would require you to make always dumps of it. Even though you could automate this, I also don't recommend it, because it could bloat your commit history too. If you need inspiration of a .gitignore file, there is a popular GitHub-repository with templates for other systems. Maybe ProcessWire could be added too. Regards, Andreas1 point
-
I would start with adding echo and exit() in site root index.php or (admin.php?) on various lines to see where it starts failing. If the echoes are shown and you reach the end of the file, move on to the next php file. Another issue could be htaccess. I would try to uncomment sections and see what happens.1 point
-
Hello PawelGIX, have you tried to enable debug mode, to see more details? Of course the debug mode shouldn't be enabled on a live site, but you could enable it just for a short time, until you know the issue. Regards, Andreas1 point
-
Hello everyone, greetings from Belo Horizonte / Brazil. I'm on the process of converting a site from WP to Processwire, this one: http://www.ricardo-vargas.com I needed a simple Flickr Gallery and tried to find a way to create album pages via API and download the images to the local filesystem (just a few, for cache purposes). So I created yesterday a simple script that, given an album ID, download its data using cURL and save the photos to a temp dir. After that, add them to a new page under /pictures/ Feel free to comment on the code, I'm a designer, not a developer, and this is my first time using PW API You can grab it on GitHub: https://github.com/sjardim/processwire-simple-flickr-album Instructions Download the files Put the templates/get_flickr_sets.php on your templates/ folder. Create a page on Processwire using this template Create or edit the page where the albums will be created. In my case it was /pictures/ IMPORTANT: Add guest edit/create permissions to this /pictures/ page, otherwise the script won't work Create a temp dir on your server and set it on the previous file Get a Flickr API on https://www.flickr.com/services/apps/create/ Add one or more Flickr album IDs on get_flickr_sets.php Open the page using the get_flickr_sets.php template on your browser <?php include "../lib/curl.class.php"; // You will need to get a Flick API Key // Get it here: https://www.flickr.com/services/apps/create/ // Load it on the file below include "../lib/flickr_album_utils.php"; function download_file($url) { // Save the image on local filesystem (You need to create this folder first) // On your server it can be /var/www/name_of_folder/ $tempdir = '/Users/XXX/phpFlickrCache/'; $fp = $tempdir . basename(parse_url($url, PHP_URL_PATH)); // if we already downloaded the images for some reason (like testing), just return it if (!file_exists($fp)) { $fh = fopen($fp, 'wb'); $curl = curl_init($url); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl, CURLOPT_BINARYTRANSFER, 1); curl_setopt($curl, CURLOPT_FILE, $fh); curl_exec($curl); curl_close($curl); fclose($fh); } return $fp; } // Get some public album id to test $albumID = ["72157636029541784"]; //$albumID = ["72157649576832173", "72157633296236495", "72157644132091553", "72157636029541784"]; // Load ProcessWire API $pages = wire('pages')->get('/pictures/'); /* -------------------------- GET ALBUM INFO FROM FLICKR -------------------------- */ foreach($albumID as $album) { // Via GET, return album and its photos info $album = fa_get_album($album); // create a new post $page = new Page(); $page->template = 'picture_album'; $page->parent = $pages; // disable page output formatting $page->of(false); $page->name = wire('sanitizer')->pageName($album['title'], true); $page->flickr_album_id = $album['id']; $page->title = $album['title']; $page->generic_integer = $album['total']; //total number of photos on flickr album – OPTIONAL //My client albums descriptions have two phrases, one in English and other in Portuguese // let's separate then by the period, but sometimes there is no period, so the PT description will remain blank $description = explode('.', $album['description']); $en = $languages->get("default"); $page->summary->setLanguageValue($en, $description[0]); $pt = $languages->get("portuguese"); $page->summary->setLanguageValue($pt, $description[1]); $page->set("status$pt", 1); //activate portuguese page $page->save(); // We need to save the page BEFORE adding images /* ------------------------------------ DOWNLOAD AND SAVE IMAGES FROM FLICKR ------------------------------------ */ $images = array(); $i=1; $maxImages = 11; foreach($album["all_images"] as $f) { //we do not want all the photos, just a little bit if ($i >= $maxImages) break; // mount the flickr photo url using its attributes $photo_url = 'https://farm'.$f["farm"].'.staticflickr.com/'.$f["server"].'/'.$f["id"].'_'.$f["secret"].'_b.jpg'; // download and return the image file in the filesystem $images[$album['id']][$i] = download_file($photo_url); // add images to the current page in the loop $page->images->add($images[$album['id']][$i]); $i++; } $page->save(); echo "<p>Created page for album: <strong>".$album['title']. "</strong></p>"; // Tip: Now, after we saved the images to ProcessWire /site/assets/files/, we can safely delete them from the $tempdir if needed } print "<pre>"; print_r($images); print "</pre>"; Admin Screenshot1 point
-
Hej, without having read the whole post, just a quick reply about preg_replace() and regular expressions - it is definately useful to learn that stuff! Have a look at these sites: http://www.phpliveregex.com regular expressions in php and the according php functions http://www.regexr.com live editing of regular expressions - very nice to learn Regular expressions let you search for patterns in strings. E.g. you have a link <a href='url'></a> And then you could write some code which identifies the 'url' part and replaces it with 'url#anchor' - for example. And in your case you could limit that to the first level - it might be a bit tricky - but that topic is good to know anyway. Will get back to you later, have to go Edit: Ah, and the "hard coding" needn't be that "hard coded". Sometimes I use a pagefield on the homepage to let the user add items to the menu (which is based on that pagefield). Subpages could be generated depending on themplate or so - but that depends on your whole site concept. ... But there are many possibilieties!1 point
-
Yes I think that is the best. Make a copy and upgrade it in a test environment. I think everything is going to be smooth but is always the best asking if there was any issue on that. Many thanks1 point
-
I've been running 3.0.x with a bunch of 2.5x modules and so far had no problem. Which module(s) in particular do you have concern with?1 point
-
1 point
-
1 point
-
1 point
-
Hi @horst, Do you mean a mean the access to the page is blocked, or access to files stored in a files/images field on the page? For the page itself I would think you'd use role-based access, or just do not give the page's template a template file. But you would have thought of this already so maybe you need something else? For the files you can enable $config->pagefileSecure and then do not give the guest role access to the page. See the blog post and the $config docs. Also, there is the FieldtypeSecureFile module.1 point
-
Hi @kongondo I wanted to ask if its possible to have this list view change for the media manager fields also for the media manager process page? My Customer wants to see the filename of every image/file without clicking on it. And have you thought about integrating this fixed filters(like Lister Pro) for the media manager? My customer needs them since it's a big company with many workers, and it would be just time consuming to build the filters every time when the user is logged in. Greetings Orkun1 point
-
1 point
-
@vwatson - I assume you got this sorted out - could you explain what you found, or if it's still a problem. Thanks!1 point
-
Are you sure of this? I tested it quickly and it seems to not populate the field when set to hidden. If the inputfield is hidden then I expect its render method is never called so no default value is entered into it. Is there a difference between what you're wanting to do with this field and the "created" property that exists by default when adding a new page? Because if your field is hidden then nobody could ever edit it so it would always remain identical to the created datetime. So could you just sort your pages by "created"?1 point
-
Not sure, but I think it is intentional. But also, you always can (re)order / sort it after adding a complete PageArray at once: http://cheatsheet.processwire.com/pagearray-wirearray/sorting-and-filtering/a-sort-property/ EDIT: Ok, thats not my evening. @BitPoet has already linked to PageArray->sort(), also to the newer API docs. Good night all together.1 point
-
looks like it is back up, can't see any issues from here. https://en.wikipedia.org/wiki/ProcessWire1 point
-
1 point
-
A couple of requests to make working with templates in Admin more streamlined: 1. Display the "Label" field in the "New Template" screen - I always like to label my templates and currently this requires you to re-open the template you have just created. Also, I'd rather have the template screen remain open after adding a template rather than be sent back to the Templates overview. These changes would make the "New Template" process more consistent with the "New Field" process. But of course the likely reason for no Label field and the closing of the template screen is because it's actually "New Templates" plural not "New Template" singular. Myself, I've never felt the need to add multiple templates at once but I expect others do. Maybe "New Template" and "New Templates" could be separate commands? 2. When duplicating a template (Add New Templates > Duplicate fields used by another template) it would be nice if field overrides (widths, descriptions, etc) were included in the new template(s). It can be quite time-consuming to set these up, and if you are duplicating fields of an existing template I think you also want to duplicate the overrides more often than not.1 point
-
@Michael Murphy Have already tried this one? http://modules.processwire.com/modules/process-wire-upgrade/ It does what you described but automatically. If you also have this one installed...: http://modules.processwire.com/modules/process-database-backups/ ...then the upgrade module can optionally create a db backup for you, which is recommended anyway. I recently had an issue though, but it was not the module's fault, it was a GitHub issue when github.com failed to deliver the archive of ProcessWire so the update failed too but the site was intact so no harm was done. After GitHub had come back I could upgrade without issues.1 point
-
I also worry about doing upgrades despite having done it so many times. The least stressful approach I have found is to rename the existing wire folder, index.php and .htaccess files, and then upload the new ones. So first I rename the existing files like this: wire-old index-old.php .htaccess-old Then I copy over the latest wire, index.php and .htaccess files. If something goes wrong during the upgrade, you can then easily delete these new files and rename the -old files. This approach feels quicker and also avoids those dialogs asking about overwriting files.1 point
-
@EyeDentify, also without any asperger, it is sometimes hard to grasp things. (the forums are full of examples, ) But yep, with PW it is really nice to work. You can start with simple things and then go deeper and deeper. Every step gives you a bit more learning and understanding. And that's why you want to go deeper again. (but caution: it can be a bit addictive!)1 point
-
I want to add my 2 cents too. @Soma: yes it maybe error prone, and yes some of these steroids should belong into the core. In the past we have had some small modules that tweeked a single thing in the admin, fe add more button functionality for pages directly in the page tree overview, your "page is edited reminder" to avoid accidentaly leaving a page without saving, and others. Over the time, many of this was included into the core. And I believe not all would have benn incorporated without becoming a module first. So, besides all the good steroids stuff here, there are two things I additionally like on AdminOnSteroids: 1) that it collects many usefull parts into a single collection, avoiding to deal with 10+ small modules, and 2) to have the ability to see (and early use) what all can be possible. Ah, there are more: 3) for Ryan it can be a good way to just try out things, and, hopefully incorporate some into the core than. 4) I can decide for every single feature to en- or disable it. I even can install AOS and have the unchanged default admin theme. So, if there is an error (CSS/JS) I simply can disable a feature or the complete module.1 point
-
Ryan, big thanks for putting this into core! This is all magic by sforsman. For us use cases are things like looping and sending newsletters, big exports etc. Really a big difference in performance, memory usage and code simplicity when working with more than 10 000 pages.1 point
-
That makes such a huge difference - I have a query (that I was obviously caching) which was taking around 4-5 minutes, that now happens in 45seconds! Obviously I still need to optimize some other components, but this is a huge improvement - thanks to everyone involved in this!1 point
-
It's your account. Nobody will prevent you from deleting it1 point
-
I would suggest considering moving a smaller site where this happens regularly to another server with a different host if you can to see if that resolves things. That would pinpoint a server config issue right away if the issue is happening a lot.1 point
-
Old topic but maybe can be useful. What about adding a global variable? Like this: $port = ($_SERVER['SERVER_PORT'] == 80 || $_SERVER['SERVER_PORT'] == 443) ? '' : ':' . $_SERVER['SERVER_PORT']; $protocol = ($_SERVER['SERVER_PORT'] == 443) ? 'https://' : 'http://'; if(!$config->siteURL) $config->siteURL = $protocol . $_SERVER['SERVER_NAME'] . $port . '/';1 point
-
I don't have a simple solution to this one, but will do more thinking about how I could have ProcessWire provide a hook like Pages::statusChanged or something like that. But until we have something like that, here are a couple ways you could do it: Option 1 Add a hook to Pages::saveReady and have your hook function do something like this: Pages::saveReady hook $page = $event->arguments[0]; if($page->id && $page->isChanged('status') && !$page->is(Page::statusUnpublished)) { $result = $this->db->query("SELECT status FROM pages WHERE id={$page->id}"); list($status) = $result->fetch_row(); if($status & Page::statusUnpublished) { // page is about to be published // send your email } } Option 2 The other option would be to change your workflow such that user submitted pages went into a different parent than the live ones. For instance, user-submissions might go into parent /pending/ and published submissions would live in /live/. Then you could have your hook monitor for when a page is moving from /pending/ to /live/. If you wanted to, you could also have it take care of the publishing automatically: Pages::saveReady hook $page = $event->arguments[0]; if(!$page->parentPrevious) return; // if page is not being moved then stop now if($page->parent->name == 'live' && $page->parentPrevious->name == 'pending') { $page->removeStatus(Page::statusUnpublished); // send your email }1 point