示例#1
0
文件: jobs2.php 项目: royalswe/yas26
    global $setting;
    $filename = $setting['sitepath'] . "/jobs_log.txt";
    $fh = fopen($filename, "a");
    fwrite($fh, date("d-m-Y, H:i") . " - {$text}\n");
    fclose($fh);
}
$currentIp = new usersOnline();
$now = time();
$midnight_today = mktime(23, 59, 59);
$plus_week = strtotime('+7 days', $midnight_today);
$plus_month = strtotime('+30 days', $midnight_today);
$update = 0;
// empty daily game plays
if ($jobs['dayplays'][2] != 0 && $jobs['dayplays'][1] <= $now || $runjob == 'dayplays') {
    $update = 1;
    $displayIp = $runjob == 'dayplays' ? 'Admin' : $currentIp->ipCheck();
    yasDB_update("UPDATE `stats` SET numbers = 0 WHERE id = 2");
    yasDB_update("UPDATE `stats` SET numbers = 0 WHERE id = 3");
    $jobs['dayplays'][1] = $midnight_today;
    doLog("Daily game plays emptied triggered by visitor " . $displayIp);
}
// create game feeds
if ($jobs['feeds'][2] != 0 && $jobs['feeds'][1] <= $now || $runjob == 'feeds') {
    $update = 1;
    $displayIp = $runjob == 'feeds' ? 'Admin' : $currentIp->ipCheck();
    $rrsfile = $setting['sitepath'] . '/rss-arcade.xml';
    $rss_intro = "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n";
    $rss_intro .= "<rss version=\"2.0\">\n";
    $rss_intro .= "<channel>\n";
    $rss_intro .= "<title>" . $setting['sitename'] . "</title>\n";
    $rss_intro .= "<link>" . $setting['siteurl'] . "</link>\n";