dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROMbbs_posts
JOINusersONusers.id=bbs_posts.author
GROUPBYbbs_posts.author
ORDERBYcDESCLIMIT20","mostbbsposts");
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROMbbs_topics
JOINusersONusers.id=bbs_topics.userfirstpost
GROUPBYbbs_topics.userfirstpost
ORDERBYcDESCLIMIT20","mostbbstopics");
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROMcomments
JOINusersONusers.id=comments.who
GROUPBYcomments.who
ORDERBYcDESCLIMIT20","mostprodcomments");
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROMoneliner
JOINusersONusers.id=oneliner.who
GROUPBYoneliner.who
ORDERBYcDESCLIMIT20","mostoneliners");
/*
dumplist("SELECT count( * ) AS c, users.nickname, users.id, users.avatar
FROMbbs_posts
JOINusersONusers.id=bbs_posts.author
WHEREbbs_posts.postLIKE'%[img%'
GROUPBYbbs_posts.author
ORDERBYcDESCLIMIT20","mostbbspostswithimages");
*/
echo"</div>";
echo"<br style='clear:both;'/>";
?>
<table>
<tr>
<td>userswhohaven'tcommentedonanyprods:</td>
<td><?
$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;
?></td>
</tr>
<tr>
<td>userswhohaven'tpostedonthebbs:</td>
<td><?
$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;
?></td>
</tr>
<tr>
<td>userswhohaven'twroteoneither:</td>
<td><?
$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;");
$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";