/****************************************************************************** SI_getWeeksHits() Created 04.04.24 v0.4b Integrated 04.06.19 v0.31b for Andrei Herasimchuk ******************************************************************************/ function SI_getWeeksHits() { global $SI_tables,$tz_offset; $dt = strtotime(gmdate("j F Y",time()+(((gmdate('I'))?($tz_offset+1):$tz_offset)*3600))); $dt = $dt-(3600*2); // The above is off by two hours. Don't know why yet... $tmp = ""; $dt_start = time(); $tmp = "\n"; $tmp .= "\t\n"; $tmp .= "\t\n"; for ($i=0; $i<7; $i++) { $dt_stop = $dt_start; $dt_start = $dt - ($i * 60 * 60 * 24); $day = ($i)?gmdate("l, j M Y",$dt_start):"Today, ".gmdate("j M Y",$dt_start); $query = "SELECT COUNT(*) AS 'total', COUNT(DISTINCT remote_ip) as 'uniques' FROM $SI_tables[stats] WHERE dt > $dt_start AND dt <=$dt_stop"; if ($result = mysql_query($query)) { if ($count = mysql_fetch_array($result)) { $tmp .= "\t\n"; } } } $tmp .= "
Hits in the last week
DayHitsUniques
$day$count[total]$count[uniques]
"; return $tmp; }