Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/16/2014 in all areas

  1. Hi Folks, I just added a small module that keeps track of search keywords encoded in http referrers from common search engines leading to your site. See the README for a full documentation of features. Please let me now, if you have found any issues, feature requests or opinions by leaving your comments here in the forum or on github. Regards from Hanover, Germany, Marco
    9 points
  2. I've been working on this one for a few months and just launched it this morning: http://villasofdistinction.com I also did the previous iteration of this site, 5 or so years ago (which was running ProcessWire 1.0). The new site is powered by ProcessWire 2.4 (2.3 dev). The site is responsive and designed for a good experience on both desktop and mobile. While I did all the development, the site's design/look and feel was created by the client (they have their own internal design agency). Most of the work in this project was actually not anything you can see on the front end. Instead, most of the work went towards back-end management, workflow and web services. The client has a large number of editors and agents that needed various capabilities, workflows, feeds and such. So there's a lot more going on here in terms of a management platform than in the previous iteration... and that's mostly what kept me busy for so those few months. Modules used here: Foundation 4 Profile All In One Minify (AIOM) FieldtypeMapMarker (with MarkupGoogleMap) Pro Cache Form Builder Hanna Code Redirects Selector test Changelog Version Control for Text Fields Batcher Admin Template Columns CKEditor Select Multiple Transfer CollagePlus And a few custom modules
    7 points
  3. Just wrote a new tutorial! Instead of writing it down here I did it on my recently created new blog. http://soma.urlich.ch/posts/create-a-helper-module-for-processwire/
    5 points
  4. And THERE it goes ... PW is #2! Only one more to go https://bitnami.com/contest
    5 points
  5. This viewable check is something done on runtime and not on db level. Here an example to do what you want: $excl_tpls = "template!="; foreach($templates as $tpl){ if($tpl->filenameExists()) continue; $excl_tpls .= "$tpl->name|"; } $excl_tpls = rtrim($excl_tpls,"|"); foreach($pages->find("parent=1, $excl_tpls") as $p){ $content .= "<p>{$p->title}</p>"; }
    5 points
  6. Too simple to be a module, consider a script like this: $array = $pages->find("template=basic-page")->explode(function($item){ return array( 'id'=> $item->id, 'title' => $item->title ); }); $fp = fopen('file.csv', 'w'); foreach ($array as $fields) fputcsv($fp, $fields); fclose($fp); Note, $pagearray->explode() used here is only available in 2.4 (2.3 dev) http://cheatsheet.processwire.com/pagearray-wirearray/getting-items/a-explode/ And the anonymous functions requires php >= 5.3 http://php.net/manual/de/functions.anonymous.php
    5 points
  7. Very, very smart. This is the kind of site that should be used as a long case study (small ebook, to be honest) going through details such as why dedicated work-flows are so important (and how to define them) the importance of rigidly defining the brief, the necessity of being able to recreate ideal workflows in the back-office for the editorial/site management reasons, the creation of an editorial hierarchy and managing it the level of expertise required to attack such a project the importance of a consistent and understandable API to have a chance of a) creating the site and b) modifying and developing the site over a sustainable period why developing such a site within a rigid structure such as Joomla or Wordpress would undermine most of the above, underlining the importance of being able to create a dedicated application And the finally, why ProcessWire made all the above not only possible, but delivers a fast, effective, enterprise class solution. So, a big PW advert, basically. ProcessWire needs such a write up.
    5 points
  8. Oh, there are plenty. Finding them awake, sitting upright and facing front is another matter, however.
    3 points
  9. Thanks Matthew! I'm always interested in the cause when someone's got a problem with a selector. Well at least when it's not an obvious one . Often it's a misunderstanding of some kind or a structure complex enough to get anyone dizzy, but then there are those few cases where someone's actually hit a bug or some other kind of bad behaviour. And those are the cases I'm always willing to try and solve. So, wilsea, I wouldn't say your issue has been fixed. That's only a workaround. Of course it may be one good enough for your particular case, but at least I'm still wondering what's the reason. You checked the code lengths from the original table if I'm not mistaken? Could you run the check against the data in the "field_code" table (if the field is called "code" then that would be the table with the code strings in a field called "data")? Just to rule out the possibility of some inconsistency there. I'm guessing you've generated the pages in PW using a script and there just might be something wrong there. If everything seems fine there also, could you give a couple of example codes (working and not working ones)? There really has to be some explanation why you've run into this behaviour. Don't get me wrong - I'm glad you got the expected results and you're probably just fine using this approach. Just being curious .
    3 points
  10. Good to now! I was able to pull this off like this for now. Thanks a lot for your input! Maybe a config page will be better for a public module, off course. <?php class EmailNewUser extends WireData implements Module { /** * getModuleInfo is a module required by all modules to tell ProcessWire about them * * @return array * */ public static function getModuleInfo() { return array( // The module's title, typically a little more descriptive than the class name 'title' => 'Email New Users', // version: major, minor, revision, i.e. 100 = 1.0.0 'version' => 101, // summary is brief description of what this module is 'summary' => 'Send New users a welcome email', // Optional URL to more information about the module 'href' => '', // singular=true: indicates that only one instance of the module is allowed. // This is usually what you want for modules that attach hooks. 'singular' => true, // autoload=true: indicates the module should be started with ProcessWire. // This is necessary for any modules that attach runtime hooks, otherwise those // hooks won't get attached unless some other code calls the module on it's own. // Note that autoload modules are almost always also 'singular' (seen above). 'autoload' => true, ); } /** * Initialize the module * * ProcessWire calls this when the module is loaded. For 'autoload' modules, this will be called * when ProcessWire's API is ready. As a result, this is a good place to attach hooks. * */ public function init() { $this->pages->addHook('saveReady', $this, 'sendEmail'); } public function sendEmail(HookEvent $event) { $page = $event->arguments[0]; if ($page->template != "user") return; // stop here if this isn't a User // Only send an email if the User page is published (A new User goes live) if($page->isChanged('status') && !$page->is(Page::statusUnpublished)) { $body = "Welcome {$page->name}!"; $this->message("Welcome {$page->name}! A welcome email has been sent to {$page->email}."); @mail($page->email, "welcome, {$page->name}!", $body, "From:xxxxx@xxxxx.com"); } } }
    3 points
  11. First I'd check and double check the code you're searching for is exactly right - but you must have done that already to be able to give such a detailed description. Still, could those codes for pages 99.. have for example a space in the beginning? To check if the issue is about getting an exact match you could try it out with $pages->find("code%=xyz"). If this gives you the right matches then it has to be something with the data. To check the data you could see the database directly. Something like "SELECT LENGTH(data), data FROM field_code" will expose codes that have a length different from what you're expecting. Be it a 6 or 9 letter string, don't know which as the length changed in you post .
    3 points
  12. I think it would be good thing to add domain to html title in admin default theme. I added a long time ago to my admin theme. Instead of Pages • ProcessWire make it mydomain.com • Pages • ProcessWire or Pages • ProcessWire • mydomain.com This would help a lot with seeing in windows list and bookmarks, what site it is from. I can't stand seeing my co-worker looking for the correct window for hours Thanks
    2 points
  13. Up the memory max of php. That solves upload of larger files often. Also looking at console can help or server error logs. Sometimes php version also is a problem with 5.2.
    2 points
  14. Sorry for pushing this old post. Been quiet some time but have to report back with some research. Not solutions but some useful intel for other people having the same problems as me. Using a normal ProcessWire 2.3 download and installing it without any 3rd party modules produces the problems too. I've looked through the php.ini, all configs and every switch I could find. Found nothing that could possible cause the problems. Limits are way over the file sizes. File name, file content etc. isn't a problem. Tried several combinations. This problems especially occurs with PDF files and images. It's a problem with our server, not ProcessWire I've found one problem with JPG files saved in Adobe Photoshop: Open a 16bit JPG/TIFF file (e.g. from Lightroom) Saving it as a JPG with "Save as..." will cause the upload to fail. Stuck at 100%. Converting the image to 8bit in Photoshop by changing the image modus helps. Save it again and the upload works. Reproducable No idea why it happens, but this fixes some images. I've started to look closer to the PDF files and tried the same thing here: PDFs are saved with Adobe Illustrator CC via "Save copy as..." Saving a PDF with either 8bit or 16bit JPG included doesn't make a difference. Uploads fails with the default Adobe settings. Removing all meta data (previews, editable paths) doesn't help Changing the PDF version from 1.3 to 1.5 doesn't help. Specify a output color profile doesn't help But: Removing all meta data AND specify a color profile makes the upload work. Didn't get stuck with 100%. PDF 1.3 to PDF 1.5 That's all I could figure out. If you have another idea let me know. Thanks.
    2 points
  15. Greetings, Nice detective work, Nik! When I read posts like this, where someone says something is not working correctly in ProcessWire, my immediate reaction is, "You're doing something wrong." Sorry if this sounds harsh, but I have learned to trust ProcessWire that much! I bring the same judgment to myself. I've been in many situations where I develop something in ProcessWire and it doesn't do what I expected. I automatically think, "I must be doing something wrong." When something "wrong" happens, focus on yourself rather than ProcessWire. If you adjust your thinking this way, you can streamline troubleshooting. Thanks, Matthew
    2 points
  16. ProcessWire doesn't know anything about PDF files. And the file size is not large, so I think we can rule out a max_upload_size issue. If something is interfering with the upload, it would have to be lower level in the server (Apache mod_security maybe doesn't like the filename or something in the PDF file?)
    2 points
  17. Just saw (via Gertrud Schrenk) that BitNami (Company that packages popular open source apps into easy to install images in various formats, including AWS cloud images) is having a contest for which apps to include next as a package, where you can vote for ProcessWire. To quote the site: Please, all go and vote for PW at: bitnami.com/contest ! Cheers
    1 point
  18. Hi Alec, Welcome to the forums. The simple answer is yes.... the realistic answer is: Such sites will most likely require significant amounts of custom code. As you rightly stated, PW is a framework It will give you the necessary tools to build the site but you will have to get your hands dirty...Having said that, there will be some things you will be able to get with PW right out of the box, e.g. pagination... Maybe you can expound on the specs of your travel site to get better answers... These sites built with PW may be of interest: http://www.villasofdistinction.com/ http://www.goaroundeurope.com/ http://processwire.com/skyscrapers/ More here: http://processwire.com/talk/forum/9-showcase/
    1 point
  19. Running PHP Version 5.3.27, memory limit set to 64M and max_execution to 60 seconds. Trying it with 128MB now. Looking through the logs, I've found some suspicious entries. Time it little bit off: [Thu Jan 16 20:12:50 2014] [error] [client 87.165.***.***] mod_security: Access denied with code 406. Pattern match "cc:" at POST_PAYLOAD [severity "EMERGENCY"] [hostname "redacted.com"] [uri "/processwire/page/edit/?id=22354"] If this is the issue, Ryan was right. Thanks. Looking into mod_security now. EDIT: Solved! Google spit out some interessting links for "POST_PAYLOAD" and mod_security. I've deactivated the POST filtering for mod_security. Just add this to your .htaccess file: <IfModule mod_security.c> # Should mod_security inspect POST payloads SecFilterScanPOST Off </IfModule> Taken from this site (more info)
    1 point
  20. This is what Soma's referring to: http://processwire.com/talk/topic/5299-vote-for-processwire-to-be-packaged-by-bitnami/.
    1 point
  21. What version of PW are you running? Does this post help - Ryan has a fix for the current stable: http://processwire.com/talk/topic/4384-cant-empty-trash-or-delete-indivdual-trashed-pages/ PS In case you don't know, the search mechanism in this forum is not great, but the following search in google works a treat: site:processwire.com "Call to a member function hasRole() on a non-object"
    1 point
  22. Unless you're doing pagination and want it to be acurate for example. And the other way around doesn't work eighter. You can't exclude if you want. A thing mentioned by Soma ( overhead ) second post, is a reason a good reason for not being available to exclude those in a selector. ( ps I do love these discussions, these discussion make us think. I really appreciate the response from Soma & you here )
    1 point
  23. 1 point
  24. What I mean is you can render data of a page even if it has no template file. And what is wrong with excluding them by its template? Or in the find or when doing a foreach? What "obviously" doesn't work for other situations? if(!$p->viewable()) continue or simply by using template access "make" it not viewable? or by making them hidden in the tree? Then you could do a find and don't have them included.
    1 point
  25. Just done another tweet to my handful of followers: https://twitter.com/Joss_Sanglier/status/423744548498464769 Cool. Recommended to include the link as well! I also realized yesterday that if linking to the processwire page (http://bitnami.com/product/processwire), the tweet is sometimes counted as a vote (which they indeed also say), while of course the main contest link (http://bitnami.com/contest) is not. Made the mistake to only link the contest page, a few times.
    1 point
  26. Just done another tweet to my handful of followers: https://twitter.com/Joss_Sanglier/status/423744548498464769
    1 point
  27. Just 40 votes to pass # 2 now ... and 119 to pass #1 ...
    1 point
  28. I think how you are using the redirects module is still more like a url shortener than why this module exists (keeping urls form old site alive and also permanent shortcuts to most important stuff, like /board/ => /about_us/people/board/). Have you thought about creating a template called "redirect" and adding two fields for it: redirect_url & description. Template code would be: $session->redirect($page->redirect_url); You could use that method for your "non permanent" needs and keep redirects module for urls that need to live "forever".
    1 point
  29. Yeah that's usually with those hostings, they just update/change something without telling. And one morning... bamm
    1 point
  30. Hey Marty - looks great. Only comment I have is that it would be great to have a cleaner looking version of the hotel logo. It looks like there is no antialiasing on the text. I know how hard it can be to get good quality logos from businesses sometimes though
    1 point
  31. A very rewarding and engaging website. It also looks good on mobile.
    1 point
  32. Ok, now PW is 3rd To get past that, would probably need a share by twitter.com/processwire I guess ... or a few folks using the embedded vote-button on their website(s).
    1 point
  33. Simple change in the InputField (InputfieldURL.module): public function ___render() { $rootUrl = $this->config->urls->root; if($this->addRoot && !$this->noRelative && !$this->notes && strlen($rootUrl) > 1) { $this->notes = sprintf($this->_("Start local URLs with \"/\" and leave off the \"%s\" part."), $rootUrl); // Instruction for local URLs displayed when site is running from a subdirectory } $out = "\n<input " . $this->getAttributesString() . " />"; $value = $this->getAttribute("value"); if(!is_null($value) && $value !== ""){ $out .="<p class='notes'>WebSite <a target='_blank' href='".$value."'>here</a>.</p>"; } return $out; } renders as: I had never thought of this, although there have been times where this would have been beneficial. This seems something worthy of adding to the core (maybe not done in 2 minutes like mine )
    1 point
  34. I too like it. Only one issue I find with it. The "W" inside the circle reminds me of WordPress. That's the first thing that popped to mind. And the blue color scheme doesn't help since it's also close to the WP blue color scheme. That's just me though.
    1 point
  35. Will see tonight if I have the time to debug. I'm not very handy with that git stuff. // start at line 160 if(in_array($data_key, array('editRoles', 'addRoles', 'createRoles', 'roles'))) { $array = $data_value; $data_value = ''; foreach ($array as $id) $data_value .= $this->pages->get((int)$id)->name . ', '; $data_value = rtrim($data_value, ', '); } $settings_str .= "<span>$data_key:</span> $data_value<br/>";
    1 point
  36. That theme looks absolutely fantastic Adam! I love the traffic lights idea! Reaction and activity to take PW admin to next level tells something about how keen people are for PW. Can't wait to start testing this one Adam.
    1 point
  37. Edit the line that it's talking about in Page.php and change it from this: if(!$template->hasRole('guest')) return false; to this: if(!$template || !$template->hasRole('guest')) return false; This change is also already present on the dev branch (I ran into the same error a few weeks ago).
    1 point
  38. There's no built-in feature for this as far as I know, but something like this could be turned into a module with relative ease. Since users are essentially pages, your module could hook into saveReady() method of pages and do it's magic (such as sending an email using user credentials, essentially info taken from that page) to this user. Password field is one I'm not very familiar with and thus I can't really say for sure if you'd be able to use it's actual value in this way. You may have to add another hook just to get that. Another option would be to avoid sending passwords and just instruct user to get a new password with "forgot your password" feature -- this is what many sites already do. Anyway, in init() of your new module you'd add a hook: $this->pages->addHook('saveReady', $this, 'sendEmail'); .. and that sendEmail method could look something like this, though probably you'd want to add some checks etc. (does email exists and so on): public function sendEmail(HookEvent $event) { $page = $event->arguments[0]; if ($page->template != "user") return; // stop here if this isn't a new user $message = "your message goes here.. or you could specify it in module settings. Hello {$page->name}!"; mail($page->email, "welcome, {$page->name}!", $body); } You'll find plenty of examples on creating modules around the forum. I hope this helps you get started! Edit: moved hook to "saveReady" instead of "saved."
    1 point
  39. This should be possible. You'd use a Pages::saveReady hook. You'll want to have your hook do something along these lines: if($page->template == 'album' && $page->isChanged('images')) { $newItems = $page->images->getItemsAdded(); if(count($newItems)) { // images were added, create your new unpublished blog post // the $newItems WireArray contains the images that were added } }
    1 point
  40. The page statuses are a bitmask so it's possible for there to be multiple statuses on a page, like unpublished and hidden. So it's best to add and remove statuses with the addStatus and removeStatus functions, i.e. $page->addStatus(Page::statusUnpublished); // same as: $page->status = $page->status | Page::statusUnpublished; $page->removeStatus(Page::statusHidden); // same as: $page->status = $page->status & ~Page::statusHidden; You can also check the status of a page by using the is() function: if($page->is(Page::statusUnpublished)) { ... } // same as if($page->status & Page::statusUnpublished) { ... }
    1 point
  41. No, you're not dreaming, but it's like a dream!
    1 point
×
×
  • Create New...