query("$query, threads WHERE threads.user=users.id$endp"); $desc = "Most active thread posters"; $column = "Threads"; $column2 = "threads"; } elseif ($type == 'pm') { $posters = $sql-> query("$query, pmsgs WHERE pmsgs.userto=$loguserid AND pmsgs.userfrom=users.id$endp"); $desc = "PMs recieved from"; $column = "PMs"; $column2 = "PMs"; } elseif ($type == 'pms') { $posters = $sql-> query("$query, pmsgs WHERE pmsgs.userfrom=$loguserid AND pmsgs.userto=users.id$endp"); $desc = "PMs sent to"; $column = "PMs"; $column2 = "PMs"; } else { $posters = $sql-> query("$query, posts WHERE posts.user=users.id". ($tid ? " AND thread='$tid'" : '') ." AND posts.date> '". (ctime() - $posttime) ."'". $endp); $desc = "Most active users during the last ". timeunits2($posttime); $column = "Posts"; $column2 = "posts"; } $link='$smallfont Show most active posters in the:
$link=3600>last hour
- $link=86400>last day - $link=604800>last week - $link=2592000>last 30 days $smallfont Most active users by:
new threads - PMs sent by you - PMs sent to you $tblend "; if ($loguser["powerlevel"] >= 1 && false) { // Xk will hate me for using subqueries. // No, I'll just hate you for adding this period // It's like a sore. // Also, uh, interesting I guess. The more you know. $pcounts = $sql -> query(" SELECT (SELECT sum(u.posts) FROM users AS u WHERE u.powerlevel >= 1) AS posts_staff, (SELECT sum(u.posts) FROM users AS u WHERE u.powerlevel = 0) AS posts_users, (SELECT sum(u.posts) FROM users AS u WHERE u.powerlevel = -1) AS posts_banned"); $pcounts = $sql->fetch($pcounts); print " $tblstart $tccellh colspan=2>Staff vs. Normal User Posts $tccell1>$pcounts[posts_staff]$tccell1>$pcounts[posts_users] $tccell2 colspan=2>The ratio for staff posts to normal user posts is ".round($pcounts["posts_staff"]/$pcounts["posts_users"],3).". $tccell2 colspan=2>Not included were the ".abs($pcounts[posts_banned])." posts shat out by a collective of morons. Depressing. $tblend
"; } print " $tblstart $tccellc colspan=6>$desc $tccellh width=30># $tccellh colspan=2>Username $tccellh width=200>Registered on $tccellh width=130 colspan=2>$column "; $totla = 0; for($i=1; $user = $sql -> fetch($posters); $i++) { if($i == 1) $max = $user['cnt']; if ($user['cnt'] != $oldcnt) $rank = $i; $oldcnt = $user['cnt']; $namecolor=getnamecolor($user['sex'],$user['powerlevel']); print " $tccell1>$rank $tccell1 width=16>". ($user['minipic'] ? "" : " ") ." $tccell2l>". $user['name'] ." $tccell1>".date($dateformat, $user['regdate'] + $tzoff) ." $tccell2 width=30>". $user['cnt'] ." $tccell2 width=100>". number_format($user['cnt'] / $max * 100, 1) ."%
"; $total += $user['cnt']; } print " $tccellc colspan=6>". ($i - 1) ." users, $total $column2 "; print $tblend.$footer; printtimedif($startingtime); ?>