#!/usr/bin/php -q = (date_sub(NOW(), INTERVAL 1 day))) AND (date <= NOW()) AND (draft_flag = 0)"); $B = DB_fetchArray($result); $result = DB_query("SELECT COUNT(*) AS count FROM {$_TABLES['comments']} WHERE (date >= (date_sub(NOW(), INTERVAL 1 day))) AND (date <= NOW())"); $C = DB_fetchArray($result); $today = date("D d M Y",time()-86400); $out .= "\n{$B['count']} new stories and {$C['count']} new comments\n\n"; if (file_exists("{$_CONF['path']}logs/access.log")) { $out .= "------------- Access.log --------------\n"; exec("grep '^{$today}' {$_CONF['path']}logs/access.log",$buff); $i = 0; foreach($buff as $line) { $out .= "$line\n"; $i = $i + 1; } $out .= "\n\n"; } if (file_exists("{$_CONF['path']}logs/error.log")) { $out .= "------------- Error.log ---------------\n"; unset($buff); exec("grep '^{$today}' {$_CONF['path']}logs/error.log",$buff); $i = 0; foreach($buff as $line) { $out .= "$line\n"; $i = $i + 1; } $out .= "\n $i errors\n\n"; } if (file_exists("{$_CONF['path']}logs/ban.log")) { $out .= "------------- Ban.log -----------------\n"; unset($buff); exec("grep '^{$today}' {$_CONF['path']}logs/ban.log",$buff); $i = 0; foreach($buff as $line) { $out .= "$line\n"; $i = $i + 1; } $out .= "\n $i Bans\n\n"; } if (file_exists("{$_CONF['path']}logs/spamx.log")) { $out .= "------------- spamx.log ---------------\n"; unset($buff); exec("grep '^{$today}' {$_CONF['path']}logs/spamx.log",$buff); $i = 0; foreach($buff as $line) { $out .= "$line\n"; if (stristr($line,"Found Spam")) { $i = $i + 1; } } $out .= "\n $i Spam comments found\n"; } COM_mail($_CONF['site_mail'],$_CONF['site_name'] . ' Stats for ' . $today,$out); ?>