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[] = "posts.date > ".(ctime()-$posttime); $during = ' during the last '.timeunits2($posttime); } if (empty($qstrings)) $qwhere = '1'; else $qwhere = implode(' AND ', $qstrings); $posters = $sql->query( "SELECT forums.*,COUNT(posts.id) AS cnt ". "FROM forums,threads,posts ". "WHERE posts.thread=threads.id ". "AND threads.forum=forums.id ". "AND {$qwhere} ". "GROUP BY forums.id ORDER BY cnt DESC"); $userposts = $sql->resultq("SELECT COUNT(*) FROM posts WHERE $qwhere"); $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 forums$during: $tblstart $tccellh width=20>  $tccellh width=100>  $tccellh>Forum $tccellh width=60>Posts $tccellh width=80>Forum total "; for ($i=1;$f=$sql->fetch($posters);$i++) { print ''; if($f['minpower']>$power) { $link="(restricted)"; $viewall="(view)"; } else { $link="$f[title]"; $timeid = (($posttime !== 0) ? "&time={$posttime}" : ''); $viewall="(View)"; } if (!$id) $viewall = ''; print " $tccell2>$i $tccell2>$viewall $tccell1l>$link $tccell1>$f[cnt] $tccell1>$f[numposts] "; } print "$tblend Total: $userposts posts$footer"; printtimedif($startingtime); ?>