resultq("SELECT name FROM users WHERE id={$id}");
}
if (!isset($_GET['posttime'])) $posttime = 86400;
else $posttime = intval($_GET['posttime']);
if (($posttime === 0 || $posttime > 2592000) && !$id)
$posttime = 2592000;
if ($posttime !== 0) {
$qstrings[] = "p.date > ".(ctime()-$posttime);
$during = ' during the last '.timeunits2($posttime);
}
if (empty($qstrings)) $qwhere = '1';
else $qwhere = implode(' AND ', $qstrings);
$posters = $sql->query(
"SELECT t.id,t.replies,t.title,t.forum,f.minpower,f.title ftitle,COUNT(p.id) cnt " .
"FROM threads t,posts p,forums f " .
"WHERE p.thread=t.id AND t.forum=f.id AND $qwhere " .
"GROUP BY t.id ORDER BY cnt DESC,t.firstpostdate DESC LIMIT 1000");
$lnk="During last hour |
$lnk=86400>During last day |
$lnk=604800>During last week |
$lnk=2592000>During last 30 days".
((!$id) ? "" : " | $lnk=0>Total").
"
$fonttag Posts $by in threads$during:
$tblstart
$tccellh width=30> 
$tccellh width=300>Forum
$tccellh>Thread
$tccellh width=70>Posts
$tccellh width=90>Thread total
";
for($i=1;$t=$sql->fetch($posters);$i++) {
$t['title'] = str_replace(array('<', '>'), array('<', '>'), $t['title']);
if($t['minpower']>$power && $t['minpower']>0) {
$forum = '(restricted forum)';
$thread = '(private thread)';
}
else {
$forum = "{$t['ftitle']}";
$thread = "{$t['title']}";
}
print "