includes/functions.php
changeset 180 3dbe848431b0
parent 174 d74ff822acc9
child 183 eec079676fe7
child 195 3daa715e0f69
equal deleted inserted replaced
179:e858bacb5cfa 180:3dbe848431b0
  3166   }
  3166   }
  3167   
  3167   
  3168   return $score;
  3168   return $score;
  3169 }
  3169 }
  3170 
  3170 
       
  3171 /**
       
  3172  * Registers a task that will be run every X hours. Scheduled tasks should always be scheduled at runtime - they are not stored in the DB.
       
  3173  * @param string Function name to call, or array(object, string method)
       
  3174  * @param int Interval between runs, in hours. Defaults to 24.
       
  3175  */
       
  3176 
       
  3177 function register_cron_task($func, $hour_interval = 24)
       
  3178 {
       
  3179   global $cron_tasks;
       
  3180   if ( !isset($cron_tasks[$hour_interval]) )
       
  3181     $cron_tasks[$hour_interval] = array();
       
  3182   $cron_tasks[$hour_interval][] = $func;
       
  3183 }
       
  3184 
  3171 //die('<pre>Original:  01010101010100101010100101010101011010'."\nProcessed: ".uncompress_bitfield(compress_bitfield('01010101010100101010100101010101011010')).'</pre>');
  3185 //die('<pre>Original:  01010101010100101010100101010101011010'."\nProcessed: ".uncompress_bitfield(compress_bitfield('01010101010100101010100101010101011010')).'</pre>');
  3172 
  3186 
  3173 ?>
  3187 ?>