Beispiel #1
0
function hourly($screen_rotate = false)
{
    //Rotate any screens that need a template rotation every 6 hours
    if (date('H') % 6 == 0) {
        if (is_array($screen_rotate)) {
            echo "Executing template rotation.\n";
            foreach ($screen_rotate as $key => $templates) {
                $scr = new Screen($key);
                $templates = remove_element($templates, $scr->template_id);
                $new_key = array_rand($templates, 1);
                $scr->template_id = $templates[$new_key];
                $scr->set_properties();
            }
            echo "Template rotation complete.\n";
        }
        echo "Hourly job complete.\n";
    }
    //End template rotation
}