resultq("SELECT name FROM users WHERE id=$id"); } else $from = ' on the board'; if ($posttime !== 0) { $qstrings[] = "date > ".(ctime()-$posttime); $during = ' during the last '.timeunits2($posttime); } if (empty($qstrings)) $qwhere = '1'; else $qwhere = implode(' AND ', $qstrings); $posts = $sql->query("SELECT count(*) AS cnt, FROM_UNIXTIME(date,'%k') AS hour FROM posts WHERE {$qwhere} GROUP BY hour"); $link = "Last day | $link=604800>Last week | $link=2592000>Last 30 days | $link=31536000>Last year | $link=0>All-time
$fonttag Posts$from by time of day$during: $tblstart $tccellh width=100>Time $tccellh width=50>Posts $tccellh> "; $postshour = array_fill(0, 24, 0); $max = 0; while($h=$sql->fetch($posts)) if (($postshour[$h['hour']] = $h['cnt']) > $max) $max = $h['cnt']; for($i=0;$i<24;$i++) { $time = sprintf('%1$02d:00 - %1$02d:59', $i); $bar = "'; print " $tccell2s>$time $tccell2s>$postshour[$i] $tccell1ls width=*>$bar "; } print $tblend.$footer; printtimedif($startingtime); ?>