require("include/top.php");
// color_title #248
// color_bottom #68a
// color_bg1 #579
// color_bg1 #468
function dumplist($sql,$n) {
$r = mysql_query($sql);
echo "
\n";
echo " ".$n." |
\n";
while($o = mysql_fetch_object($r)) {
echo " \n";
printf(" ");
printf(" ",$o->id,$o->avatar);
printf(" %s",$o->id,htmlentities($o->nickname));
printf(" | ");
printf(" %d | ",$o->c);
echo "
\n";
}
echo "
\n";
}
echo "";
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROM bbs_posts
JOIN users ON users.id = bbs_posts.author
GROUP BY bbs_posts.author
ORDER BY c DESC LIMIT 20","most bbs posts");
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROM bbs_topics
JOIN users ON users.id = bbs_topics.userfirstpost
GROUP BY bbs_topics.userfirstpost
ORDER BY c DESC LIMIT 20","most bbs topics");
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROM comments
JOIN users ON users.id = comments.who
GROUP BY comments.who
ORDER BY c DESC LIMIT 20","most prod comments");
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROM oneliner
JOIN users ON users.id = oneliner.who
GROUP BY oneliner.who
ORDER BY c DESC LIMIT 20","most oneliners");
/*
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROM bbs_posts
JOIN users ON users.id = bbs_posts.author
WHERE bbs_posts.post LIKE '%[img%'
GROUP BY bbs_posts.author
ORDER BY c DESC LIMIT 20","most bbs posts with images");
*/
echo "
";
echo "
";
?>
users who haven't commented on any prods: |
$r = mysql_query("select count(*) as c from users left join comments on users.id = comments.who where comments.id is null limit 10;");
$o = mysql_fetch_object($r);
echo $o->c;
?> |
users who haven't posted on the bbs: |
$r = mysql_query("select count(*) as c from users left join bbs_posts on users.id = bbs_posts.author where bbs_posts.id is null limit 10;");
$o = mysql_fetch_object($r);
echo $o->c;
?> |
users who haven't wrote on either: |
$r = mysql_query("select count(*) as c from users left join comments on users.id = comments.who left join bbs_posts on users.id = bbs_posts.author where bbs_posts.id is null and comments.id is null limit 10;");
$o = mysql_fetch_object($r);
echo $o->c;
?> |
/*
users who only posted in the random image thread: |
$sql = "select count(*) as c from (select count(*) as c, bbs_posts.topic as tpc from users left join bbs_posts on users.id = bbs_posts.author group by bbs_posts.topic) as t where t.tpc=2735";
$r = mysql_query($sql) or die(mysql_error());
$o = mysql_fetch_object($r);
echo $o->c;
?> |
*/
require("include/bottom.php"); ?>