Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/29/2015 in all areas

  1. Or better named $pagefile = $event->arguments("pagefile"); $id = $event->arguments("id"); $n = $event->arguments("n");
    2 points
  2. I think it would be the easiest from what I understand you are going to do. And imho it's the most convenient and scalable way. By the way, PageTable are in fact individual pages to. But you could go with them as they show more information on the parent page, and you could make them save the table "rows" as child pages, too
    2 points
  3. New version out (0.0.2) Allows user define global data output in module options + individual data based on template. Added forum user Manol's feature request regarding PageImage and PageFile fields.
    2 points
  4. I released a simple module: Processwire Dice Captcha Module This is a very simple captcha module. For more extensive information please read the REAMDE on github. If you want you can change the jpg files and adapt the size setting in the module accordingly. This should also increase security as if you use more complex images they will be harder to recognize. You can als change the number of dices asked for. Usage: <?php //Init Module $dice = $modules->get("FormDiceCaptcha"); //On submit check if the validation is correct if($input->post->submit) { //validate - the value is stored in the session if(!$dice->validate($input->post->captcha)) echo "<p class='error'>".__("Please check that you have completed all fields")."</p>"; else echo "Success!"; } ?> <form method="post" action="./"> <!--Show captcha --> <img src="$dice->captcha()"/> How much is the sum of the dices? <!--ask for sum --> <input type="text" name="captcha" value="$form[captcha]"/> <input type="submit" name="submit" value="submit"> </form> Github: https://github.com/romanseidl/FormDiceCaptcha Changelog 0.1.1 Changed the directory structure to conform with Processwire standards and renamed the module classname to FormDiceCapture to conform naming conventions. Also the github project had to be renamed. In case you have version 0.1.0 installed you will have to change the calls to $modules->get('DiceCaptcha') to $modules->get('FormDiceCaptcha') after updating to 0.1.1.
    1 point
  5. Hi, first of all I'd like to thank you all, and in particular Ryan, for this great project which is ProcessWire. I'm using ProcessWire for the first time and frankly I'm finding it quite good, despite my lack of experience. Anyway, I created this post to introduce you the following module, on which we are working, and I'd like to share it with the community which could benefit from it and maybe improve it. You can find the module here: https://bitbucket.org/mauro_mascia/processwire-social-login/ Basically, it adds the ability to allow a social login (using the HybridAuth library - https://github.com/hybridauth/hybridauth) as well as a standard login, user profile and registration. The module is clearly not complete and it is at its first stage of maturity and I hope you can forgive me if I have not fully complied with the PW best practices
    1 point
  6. I wish there was support for progressive JPEG. To control it, set it in the imageSizerOptions array.
    1 point
  7. I'm not quite sure what you are getting at by the virtual part but it is possible since a while to have users under different parents. http://processwire.com/blog/posts/processwire-core-updates-2.5.14/
    1 point
  8. Just a heads-up: As mentioned, lot's on the plate these days. But I've made a decision regarding the module going forward. When the next one or two PW minor stables come out, I'm going to start making Jumplinks 2.6-only. Lots of goodies I want to use, and as stated earlier in this thread, Jumplinks is mostly for new sites resulting from migrations. Of course, Jumplinks won't upgrade for anyone using it on 2.5.3. Also, and because of this decision, I'll be switching over to some kind of autoload solution so I can split up logic etc. It's essentially going to be a rewrite. Nonetheless, it will function exactly the same, sans the 404 Monitor, which I'll try to release at the same time. Speaking of the 404 monitor, I've already drawn out some blueprints and flow charts - ideas have come to mind, and I think it's going to be a really helpful module. As said, it will mesh well with Jumplinks. Edit: Okay, I see that 2.6.1 is already on stable (of course, it should be). I'll need some time before I start this up.
    1 point
  9. Fixed a bug in the changePageTemplate method. Thanks @Macrura for reporting !
    1 point
  10. Thank you LostKobrakai! this is how I solved the problem, maybe is not the most elegant but it works if (!$page->title) { $italiano = $languages->get("italiano"); $page->setOutputFormatting(false); $pagetitle = $page->title->getLanguageValue($italiano); // get the unformatted value if (!$pagetitle) { $spanish = $languages->get("spanish"); $page->setOutputFormatting(false); $pagetitle = $page->title->getLanguageValue($spanish); } if (!$pagetitle) { $portuguese = $languages->get("portuguese"); $page->setOutputFormatting(false); $pagetitle = $page->title->getLanguageValue($portuguese); } if (!$pagetitle) { $japanese = $languages->get("japanese"); $page->setOutputFormatting(false); $pagetitle = $page->title->getLanguageValue($japanese); } if (!$pagetitle) { $french = $languages->get("french"); $page->setOutputFormatting(false); $pagetitle = $page->title->getLanguageValue($french); } if (!$pagetitle) { $russian = $languages->get("russian"); $page->setOutputFormatting(false); $pagetitle = $page->title->getLanguageValue($russian); } if (!$pagetitle) { $pagetitle = "E00.000.0"; } $page->set("title", $pagetitle); $page->save("title"); $page->setOutputFormatting(true); }
    1 point
  11. That's sound like a good way of doing. I think it would be easier for a admin point of view if the tour dates could be added/edited below the parent tour information. As it theory the only fields I would have for the tour date would be start date, spaces, free spaces and discount price Hello Sarah, Thanks for your reply, Each tour could have multiple dates so would that be the parent page of TourDates. So would I keep the free seats within the TourDates page and count the number of booking for that cruise via Bookings (SeatsBooked) to update the FreeSeats or I am missing something more obvious? For example : --Tour (Fields : NumberOfNights, Price, ) ---TourDates (Fields : StartDate, Seats, DiscountPrice, FreeSeats ) ----Bookings (Fields : SeatsBooked, Name, etc) Cheers Jon
    1 point
  12. Hi guys, Got a wee issue that hopefully someone here can clear up. I have a page with a field called features, the field type is page and it has pages that belong to it. I want to be able to query against that to return all the pages in a list that have one or more of those features ticked. Here is my code at the moment. What I would have thought is it would be something like featured.subfield = 1. $query = ''; if(isset($location) && $location != ''){ $query .= ",location=".$location; } if(isset($minPrice) && $minPrice != ''){ $query .= ",askingprice2>".$minPrice; } if(isset($bedrooms) && $bedrooms != ''){ $query .= ",number_of_bedrooms>=".$bedrooms; } if(isset($maxPrice) && $maxPrice != ''){ $query .= ",askingprice2<".$maxPrice; } $query .= ",start=".$start.",limit=".$limit; //var_dump($query); $saleproperties = $pages->get(1167)->children($query); $pagination = $saleproperties->renderPager(array('listMarkup' => "<ul class='pagination'>{out}</ul>")); echo $pagination;
    1 point
  13. Jon, indeed the easiest way would be a field (i.e. 'free_seats') on each tour page (= child page of a tour date). Then you would use something like: public function calculateFreeSeats(Page $tour, $order) { if ($tour->free_seats) { $tour->setOutputFormatting(false); $tour->free_seats = ($tour->free_seats - $order->seats); $tour->save(); } }
    1 point
  14. It works as always with params: $inputfield = $event->object; $pagefile = $event->arguments(0); $id = $event->arguments(1); $n = $event->arguments(2);
    1 point
  15. I think the WireMailMandrill module is wrongly set to singular: https://github.com/craigrodway/WireMailMandrill/blob/develop/WireMailMandrill.module#L31 Juts try out with setting this to false, and if it works, drop a note to @Craig. My WireMailSmtp is set to false here, Teppos WireMailSwiftMailer is also set to false.
    1 point
  16. I am happy you like the website. I can't take credit for the design, because that was made by an co-worker, but I will let him know. The long scrolling after clicking the last reference is indeed a little obstacle. When I developed the site I didn't expect that there would be so many references. That is one of the disadvantages of a single page design. It seems like the caching is already doing its job, because I didn't switch the server yet. But 2,4 seconds loading time is already an improvement.
    1 point
  17. Both of those should work. $page->select = 1; $page->set("select", 1); P.S. Remember to save everything in the end.
    1 point
  18. Updating to PW 2.6.0 stable solves the problem - the whitespace at the beginning is gone.
    1 point
  19. Sorry Bernhard haven't noticed your earlier posts. I experienced something like that with the backend admin url, but not sure anymore what it was. I have a project where I use it but that is a even a newer version than the current. So I might have it already fixed there. The other is something I see a problem with current implementation using strpos() on those domains. "site1.dev" is found in "sub1.site1.dev" thats why you have a problem. I'm not sure about a fix yet. I haven't got a testinstall I can play with currently, but will look into it soon. Thx.
    1 point
  20. You're using subfields the wrong way. "features" holds a few pages, which on their own hold fields. E.g. "features.title=Garden" would find all properties, which has (at least one) page selected in features, that has a title of "Garden". Subfields are in this case all the fields of the linked pages. You should be aware that theoretically titles could not be unique, therefore if you can't be sure about that you could fallback to using the id instead if the title. If you query multi-pagefields directly, then it automatically queries for id's so "features.id=1015" is the same as "features=1015".
    1 point
  21. Just pushed a (major) update which adds a new feature: Change Page Template. Change Page Template: Just before the Page::loaded event the selected file is set as template file for the page. This enables you to have multiple file templates for the same page, selectable by the editor. This setting can only be applied once per a page and folders are exluded from the select inputfield. Note that a page with no associated template file will render fine with a selected file. + Changed the sorting from SORT_NATURAL flag to the natcasesort function because the flag requires PHP 5.4.0 or higher. First post is modified & please report issues.
    1 point
  22. Would anyone be interested in a ProcessWire-themed meetup/social gathering in the UK?
    1 point
  23. I'm in the UK right now until Christmas. I'm staying at Croydon, about 10 minutes from central London. Are there any ProcessWire developers nearby?
    1 point
  24. +1 ... and also to get better scores on WebPageTest page
    1 point
  25. In case you want it a little more simpler $pages->setOutputFormatting(false); $pag = $pages->find("template=basic-page"); foreach($pag as $p) { foreach($languages as $lang) { if($lang->isDefault()) continue; $p->set("status$lang", 1); $p->save(); } }
    1 point
  26. Thanks! Just in case anybody else searches for similar things, here's a simple example $en = 'status' . $languages->get('en'); $us = 'status' . $languages->get('us'); $fr = 'status' . $languages->get('fr'); $pag = $pages->find("parent=1072, template='product'"); foreach($pag as $p) { $p->setOutputFormatting(false); // not sure if necessary here - I made it a habit to always include it, just in case... $p->$en = 1; $p->$fr = 1; $p->$us = 1; $p->save(); }
    1 point
  27. Er ... depends which pub you went in. Try Earls Court - the Aussies down there couldn't tell a Slovakian from a Welshman after about nine in the evening ... *Joss ducks before someone throws a tinny at him* (Sorry, that is a ton too many London references - I have probably lost about 90% of my audience)
    1 point
  28. Stop it you bloody wankers! --- Would I pass for english guy?
    1 point
×
×
  • Create New...