comments in gallery - Page 3 comments in gallery - Page 3
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

comments in gallery

Started by heavensportal, January 25, 2014, 03:20:42 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Αndré

Your latest code checks for group ID 19, but your admin group ID is probably 1?

heavensportal

eeek, I was still using the group post id number...changed it and now the admins are no longer listed.....happy dance.

Thanks for putting up with this old woman trying to learn stuff.

Have a wonderful Valentine's day.

Αndré

It seems the bridge file is documented wrongly, at least from our result here:
Quote'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();

heavensportal

 :-*

Yes everything is as it was with the last code before this one...replace with this one and admins are still gone, thank you so very much.