posts made";
$linklist[1] = "new threads";
if ($log) {
$linklist[2] = "PMs sent by you";
$linklist[3] = "PMs sent to you";
}
if ($type == 'thread') {
$posters = $sql-> query("$query, threads WHERE threads.user=users.id"
.($time ? " AND threads.firstpostdate> '". (ctime() - $time) ."'" : '')
.$endp);
$desc = "Most active thread posters";
$column = "Threads";
$column2 = "threads";
$stat = "most thread creators";
$linklist[1] = "new threads";
} elseif ($type == 'pm') {
$posters = $sql-> query("$query, pmsgs WHERE pmsgs.userto=$loguserid"
.($time ? " AND pmsgs.date> '". (ctime() - $time) ."'" : '')
." AND pmsgs.userfrom=users.id$endp");
$desc = "PMs recieved from";
$column = "PMs";
$column2 = "PMs";
$stat = "most message senders";
$linklist[3] = "PMs sent to you";
} elseif ($type == 'pms') {
$posters = $sql-> query("$query, pmsgs WHERE pmsgs.userfrom=$loguserid"
.($time ? " AND pmsgs.date> '". (ctime() - $time) ."'" : '')
." AND pmsgs.userto=users.id$endp");
$desc = "PMs sent to";
$column = "PMs";
$column2 = "PMs";
$stat = "who you've sent the most messages to";
$linklist[2] = "PMs sent by you";
} else {
$posters = $sql-> query("$query, posts WHERE posts.user=users.id"
.($tid ? " AND thread='$tid'" : '')
.($time ? " AND posts.date> '". (ctime() - $time) ."'" : '')
.$endp);
$desc = "Most active posters";
$column = "Posts";
$column2 = "posts";
$stat = "most active posters";
$linklist[0] = "posts made";
$type = '';
}
$link='$smallfont
Show $stat in the:
$link=3600>last hour - $link=86400>last day - $link=604800>last week - $link=2592000>last 30 days - $link=0>from the beginning
$smallfont
Most active users by:
".implode(" - ", $linklist)."
$tblend
";
if ($time)
$timespan = " during the last ". timeunits2($time);
else
$timespan = "";
/*
if ($loguser["powerlevel"] >= 1) {
// 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$timespan
$tccellh width=30>#
$tccellh colspan=2>Username
$tccellh width=200>Registered on
$tccellh width=130 colspan=2>$column
";
$total = 0;
for($i = 1; $user = $sql->fetch($posters); $i++) {
if($i == 1) $max = $user['cnt'];
if ($user['cnt'] != $oldcnt) $rank = $i;
$oldcnt = $user['cnt'];
$ulink = getuserlink($user);
print "
$tccell1>$rank
$tccell1 width=16>". ($user['minipic'] ? "
" : " ") ."
$tccell2l>{$ulink}
$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);