Support Forum

Top authors: How to integrate the Admin/Moderators

KA Kalle1887
Kalle1887
Member

Hello all,

Simple:press is really fantastic, but at the bottom of the forum I have a ranking list: “Top authors”.

It seems, that the administrator of the forum is not listed there. Is there a possibility to integrate that?

 

Thank you and a nice Sunday, Kalle

5 Answers

New Answer

IK Ike
Ike
Member

Hey Kalle,

To save typing it out twice, do you mind if I refer you to a post which details how to do this?

See this post – specifically post #4

And of course, do ask if you need any further help!

KA Kalle1887
Kalle1887
Member

Hi Ike,

Thank you for answering, but it seems that the files, that are mentioned, do not exist anymore?

 

I changed the file “sp-db-statistics” like that:

 function sp_get_top_poster_stats($count) {

$spdb = new spdbComplex;

$spdb->table = SFMEMBERS;

$spdb->found_rows = true;

$spdb->fields = ‘user_id, display_name, posts, admin, moderator’;

$spdb->where = ‘posts > -1’;

$spdb->orderby = ‘posts DESC’;

$spdb->limits = “0, $count”;

$spdb = apply_filters(‘sph_stats_top_posters_query’, $spdb);

$topPosters = $spdb->select();

return $topPosters;

 

….but now, no one appears anymore in the top posters list….

It is said, that this should be integrated in “spFunctions.php”…but I can`t find that file?

Furthermore, it is said one can run the sph_stats_cron hook, but how can I do that?

 And I wonder: In with table are the users saved? I can`t find the columns “admin” and “moderator”?

Thank you again, Kalle

IK Ike
Ike
Member

Well the code changes that Mr Papa posted in post number 4 were added to the SP theme’s spFunctions.php file – which is located in the SP Themes directory. This can be found in (using default theme for an example) wp-content > sp-resources > forum-themes > default > templates > spFunctions.php.

Shouldn’t really need to do any more than that, and certainly I wouldn’t have recommended changing the db statistics file.

As always we recommend making a custom or child theme to preserve the changes made, once you are happy with them!