Automatic update on visit

by ultimatebelkar, Sunday, June 23, 2013, 10:14 (4052 days ago)

Hi.

I added a couple of lines to my index.php to automatically update the feeds when I visit the page. Thought I share, as it might come in handy if you don't have the ability to call update on a cron.

"auto_update_interval" is a new INI-entry and denotes the min-time between two updates in seconds.

put this after the logger init:

// -----------------------------------
// Update
$test ="";
if (isset($_COOKIE["updated"]))
$test = $_COOKIE["updated"];
if ($test == "")
{
$loader = new \helpers\ContentLoader();
$loader->update();
setcookie("updated","true",time()+$f3->get('auto_update_interval'));
}
// -----------------------------------

Automatic update on visit

by lorddrak, Tuesday, June 25, 2013, 10:45 (4050 days ago) @ ultimatebelkar

Thank you for your work!
That's great - should be implemented in the next (official) release(s)

:-)

RSS Feed of thread
powered by my little forum