Jump to content

benbyf

Members
  • Posts

    818
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by benbyf

  1. Amazing thanks Ryan! Think the new pattern makes more sense and doesn't have a confusing name. Given the above, would it be advisable to state a $this->wire('yourModule', functionName); to be used to echo module markup in templates (e.g. instagram html code or similar), instead of the curent $module = $modules->getModule("moduleName"); Thanks!
  2. Also, added super simple ProcessSimpleAdminPage module to Intermediate modules – to show adding admin pages within a module.
  3. Couldn't find it anywhere in the docs or simply in the forums. Thanks!
  4. Added new module PageDeferredPublish to Intermediate modules - Module allows you to publish a page at a time interval in the future e.g. 24hrs. adds Publish Later buttons to edit page and page tree uses LazyCron to count down pages that are both unpublished and have been checked to publish later when page count down reaches 0, page publishes
  5. Working, legend! It was the old Unpublished pages thing again (something that tripped me up when I first start learning PW), thanks again everything seems to be working and will be releasing deffered pages module soon. (wish the forum still made solved buttons)
  6. RT @josephfcox: Eventually, all the people saying "blockchain will fix X" will get one right, and we'll never hear the end of it

  7. AAAHAHAHHAAHAAHHAH i think i know what it is, and boy is it annoying!!!! the pages im looking to target a UNPUBLISHED and therefore I cant grab them in $pages, any way of seraching for unpublished pages too? grrrrrrrrr
  8. Cron is working as it's printing to the logs so must be not finding the pages or something. Havent used $log before, and im an idiot for not, so thanks for the push in that direction for debugging.
  9. now added the $page, but still cant seem to get cron to fire. is the a simple thing to do to check if LazyCron is even working? thanks
  10. sorry my bad, i left out another function: public function publish($page) { $page->removeStatus(Page::statusUnpublished); $page->removeStatus(Page::statusHidden); $page->Save(); }
  11. Hi, I'm trying to add a hook to lazycron in my module that finds all pages with a checkbox and then sets less the seconds passed to another field, but as yet have seen anything happen. public function init() { $this->checkboxName = "pdp_pub_later_check"; $this->fieldName = "pdp_pub_later"; $this->addHook("LazyCron::everyMinute", $this, 'publishDefferedPages'); } public function ___publishDefferedPages(HookEvent $e){ // seconds since last lazycron $seconds = $e->arguments[0]; // find all pages with deffered field $defferedPages = $this->pages->find("{$this->checkboxName}=true"); // for each page decrease time for deffered field foreach ($defferedPages as $page) { // get current page time $timeTillPublish = $page->get($this->fieldName); // set time to time minus time past $timeLeft = $timeTillPublish - $seconds; // if time passed 0 or less then publish page $page->of(false); if($timeLeft <= 0){ // remove flags and save $this->publish(); $page->set($this->fieldName, 0); }else{ $page->set($this->fieldName, $timeLeft); } $page->Save(); $page->of(true); } }
  12. Will try your module for sure! Mainly wanted to know if my solution was a bad one too
  13. anything on spam filtering at all in this thread? Love the simple form but was wondering if there was a good rule of thumb for preventing bots. Currently I use a javascript solution that adds a small bit of missing information to the form after 1 second on the front end which it checks for when posted.
  14. Thanks @LostKobrakai I was able to pull my button name as a bool from the page input. $this->postPubLater = $this->input->post('my-submit-btn-name');
  15. RT @situationsUK: Looking for somewhere to make, create and explore ideas in Bristol? Talk to @_SpikeIsland https://t.co/iKnbJqPgcK https:/…

  16. @jonpearse @MrBandFriends available

  17. Hi, I've managed to add a new button to the edit page but i'm finding it difficult to catch when it's been clicked. I've attached an image with the new publish later button with the name pdp_pub_later, but when I message() the action its always ProcessPageEdit – who would I find out that my new button has been clicked? public function init() { $this->addHookAfter("ProcessPageEdit::execute", $this, 'publishLaterAndRedirect'); } public function publishLaterAndRedirect(HookEvent $e){ $page = $e->page; $action = $e->action; $this->message('action:' . $this->process); }
  18. https://t.co/isO2gDtdPJ super amazing politics and Philosophy from @BBCRadio4 unpacking the UK system and politics generally

  19. quick video to explain my CLICK BATTLE game using the #BBCmicrobit @BBCMIDigital https://t.co/PW7bNTtGnQ https://t.co/vq7N5BNHib

  20. Please write a review on #iTunes for The Machine Ethics podcast. thanks https://t.co/zwADynICEn

  21. RT @teppokoivula: ProcessWire Weekly #116 – https://t.co/2H33jCypUS #ProcessWire #PHP #CMS #CMF

  22. Thanks for the shout out about my tutorial in @processwire weekly https://t.co/ij3v0V2oJF #moduleWriting #webdesign https://t.co/aQcAqIgfnX

  23. RT @LawOfDriverless: Interviewed by @benbyford of the Machine Ethics podcast, about #law and #driverlesscars . Listen here: https://t.co/Ss…

  24. Loving the videos you get at the end of #subterfuge second still the best I've got as far. #MobileGames https://t.co/Lb1mtpryRx

×
×
  • Create New...