It seems the bridge file is documented wrongly, at least from our result here:
'usertbl_group_id' => 'id_post_group', // name of 'group id' field in users table
'grouptbl_group_id' => 'id_group', // name of 'group id' field in groups table
Basing on that documentation I created my first code, using
usertbl_group_id. Instead, it seems we need to use
grouptbl_group_id.
Please try if the following code works as expected:
<?php
$min_comments = 25;
define('IN_COPPERMINE', true);
require('include/init.inc.php');
$result = cpg_db_query("SELECT ".$cpg_udb->field['username']." AS user_name, COUNT(*) as num_comments FROM ".$cpg_udb->usertable." AS u INNER JOIN {$CONFIG['TABLE_COMMENTS']} AS c ON c.author_id = u.".$cpg_udb->field['user_id']." WHERE ".$cpg_udb->field['grouptbl_group_id']." NOT IN (".implode(', ', $cpg_udb->admingroups).") GROUP BY user_name HAVING num_comments >= $min_comments ORDER BY num_comments DESC");
pageheader();
starttable();
echo "<tr><td><strong>User name</strong></td><td><strong>Comments</strong></td></tr>";
while ($row = mysql_fetch_assoc($result)) {
echo "<tr><td>{$row['user_name']}</td><td>{$row['num_comments']}</td></tr>";
}
endtable();
pagefooter();