3 * Poor Man Cron. Execute updates on pageviews
5 * Addon Name: poormancron
9 function poormancron_install() {
11 register_hook('profile_sidebar', 'addon/poormancron/poormancron.php', 'poormancron_hook');
12 register_hook('proc_run', 'addon/poormancron/poormancron.php','poormancron_procrun');
14 logger("installed poormancron");
17 function poormancron_uninstall() {
19 unregister_hook('profile_sidebar', 'addon/poormancron/poormancron.php', 'poormancron_hook');
20 unregister_hook('proc_run', 'addon/poormancron/poormancron.php','poormancron_procrun');
21 logger("removed poormancron");
26 function poormancron_hook($a,&$b) {
28 $lastupdate = get_config('poormancron', 'lastupdate');
31 if (!$lastupdate || ($now-$lastupdate)>300) {
32 set_config('poormancron','lastupdate', $now);
33 $b .= "<img src='".$a->get_baseurl()."/queue_wrapper.php' width='1px' height='1px' style='display:none'>";
34 $b .= "<img src='".$a->get_baseurl()."/poller_wrapper.php' width='1px' height='1px' style='display:none'>";
41 function poormancron_procrun($a, $args) {
42 $argv = array_shift($args);
47 require_once($argv[0]);