Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Mods posts are included in top posters
Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Apr 16, 2013 - 1:32 pm

Is there any way we can include them..I would like everyone in the list but admins and mods are not

 

thanks

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 16, 2013 - 1:45 pm

No option to allow it but it can be done with a WP style filter on the query if you are able and interested...

andy-signature.png
YELLOW
SWORDFISH
Avatar
Dre Erwin
Member
Free Members
sp_UserOfflineSmall Offline
Apr 16, 2013 - 2:21 pm

how can that be done?

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Apr 16, 2013 - 2:37 pm

The filter (named 'sph_stats_top_posters_query') would allow you to change the SQL being used for the query. This currently looks like this:

SELECT SQL_CALC_FOUND_ROWS user_id, display_name, posts, admin, moderator FROM XX_sfmembers WHERE admin=0 AND moderator=0 AND posts > -1 ORDER BY posts DESC LIMIT 0, Z

where XX is your WP table prefix and Z is the number of posters to display (set in your options). So something like the code below placed in your SP theme functions.php file which just removes the moderator clause should do the trick...

add_filter('sph_stats_top_posters_query', 'remove_mod');
function remove_mod($sql) {
    $sql = 'SELECT SQL_CALC_FOUND_ROWS 
            user_id, display_name, posts, admin, moderator 
            FROM XX_sfmembers WHERE admin=0 AND posts > -1 
            ORDER BY posts DESC LIMIT 0, Z'
    return $sql;
}

Remember if you try this, that this data is cached and will only refresh once an hour (by default). As always we recommend that you create your own SP theme so that any customisation is not lost during a future update. (http://codex.simple-press.com/.....g-a-theme/)

 

 

andy-signature.png
YELLOW
SWORDFISH
Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 619
Members: 17361
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10127
Posts: 79625