Search the Community

Showing results for tags 'lazycron'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • ProDrafts
  • ListerPro
  • ProFields
  • ProCache
  • Form Builder
  • Likes
  • ProDevTools
  • Custom Development

Categories

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 5 results

  1. cosmicsafari

    Hi all, I have noticed that LazyCorn seems to run maybe once or twice and then just stops. Has anybody else encountered this, I have the following within 2 different modules. public function init(){ $this->addHookAfter('ProcessModule::executeEdit', $this, 'configurableButtons'); wire()->addHook('LazyCron::every15Minutes', $this, 'autoGenerate'); } public function init(){ wire('forms')->addHookAfter('ProcessModule::executeEdit', $this, 'configurableButtons'); wire()->addHook('LazyCron::everyHour', $this, 'getExport'); } Does having multiple LazyCrons setup cause any issues?
  2. Hey guys, i have some sort of events/campaigns which have a lifespan. To deactivate them i made a checkbox-field called closed and i have to deactivate them manually. I would like to put two fields in the template, startdate and enddate, which activate/deactivate that checkbox field automatically. Dou you have any idea how to bring that on the run?
  3. hello to all processwire dudes... I need your help again As you can see in my code i want to call a simple function i the processwire lazy cron hook. Lazy cron works and execute the "echo 30 seconds have passed!" But the function syncMobileDE(); does not return any results. Thanks for your advises! public function init() { $this->addHook('LazyCron::every30Seconds', $this, 'myHook'); } public function myHook(HookEvent $e) { $seconds = $e->arguments[0]; echo "30 seconds have passed!"; $this->syncMobileDE(); } public function syncMobileDE($event) { /** @var Page $page */ $page = $event->arguments(0); if($page->template->name == 'fahrzeugangebot') { $this->listCars(); $this->initDetail(); $this->message("Mobile.de synchronisiert"); } }
  4. 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); } }
  5. Biorn

    Hi guys.. Long time no see... Well, Im back to some web programming again, I have been on tour with a Odense symphony orchestra.. Ok, I havent played with cron or lazycron before, so I was wondering, can it be used to auto refresh a website? I startet a digital signage project, where Im planning to use processwire as the core, and then I need it to refresh or update the player browser every day at midnight, and maybe doing the day, when some of the items are done.. Hope you can give me an answer... // Biorn