By HMED on Monday, 08 February 2021
Posted in General Issues
Replies 7
Likes 0
Views 590
Votes 0
Hello,

I am looking to know who are my members most helpfull in previous year (2020).
Actually the leaderboard seems to show users by topics number and its not best indicator (it can include users that request help).

Can i edit this module to sort per replies numbers and not total ?

I can change the default duration by changing the parameter "duration", but for replies count only i cant find.

Or maybe it can be an sql query, both methods are good for me if possible

I would suggest that a default feature to show most active users on a aboard is great with the possibility yo choose duration and type of count (replies / topics).

Thanks a lot
Hi HMED,

Thanks for posting your suggestion.

Currently there is no parameter to separate the question and replies to get the top users in the leaderboard module.
·
Monday, 08 February 2021 19:15
·
0 Likes
·
0 Votes
·
0 Comments
·
Hi HMED,

Thanks for posting your suggestion.

Currently there is no parameter to separate the question and replies to get the top users in the leaderboard module.


Thank you Raymond

Yes i'd seen thats no option is available,
can i edit some thing in the php file as you advised me last time for duration change ?
Or with an sql query.

Thanks a lot
·
Monday, 08 February 2021 19:25
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey HMED,

You may refer to the following file getTopUsers function.
JoomlaFolder/administrator/components/com_easydiscuss/models/users.php

All I can say is you may use the condition parent_id > 0 in the #__discuss_post table to get replies only as the result.
·
Tuesday, 09 February 2021 11:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks a lot !!!!

i tried to add "AND parent_id > 0" after 'where' but i i breaked the page


if ($order == 'posts') {
$query = 'SELECT a.' . $db->nameQuote('id') . ', '
. '(select count(1) from ' . $db->nameQuote('#__discuss_posts') . ' AS b' . ' '
. 'where b.' . $db->nameQuote('user_id') . ' = a.' . $db->nameQuote('id') . ' '
. 'AND parent_id > 0'
. $durationQuery
. 'AND b.' . $db->nameQuote('published') . ' = ' . $db->Quote('1') . ') AS ' . $db->nameQuote('total_posts') . ' '
. 'FROM ' . $db->nameQuote('#__discuss_users') . ' AS a '
. 'INNER JOIN ' . $db->nameQuote('#__users') . ' AS c '
. 'ON c.' . $db->nameQuote('id') . '=a.' . $db->nameQuote('id') . ' '
. 'WHERE c.' . $db->nameQuote('block') . '=' . $db->Quote(0) . ' '
. $exclusion
. 'ORDER BY ' . $db->nameQuote('total_posts') . ' DESC '
. 'LIMIT 0,' . $count;
}

·
Tuesday, 09 February 2021 17:18
·
0 Likes
·
0 Votes
·
0 Comments
·
Hey HMED,

Please try the following(attached). Keep in mind that customization support is out of our support scope.
·
Tuesday, 09 February 2021 18:04
·
0 Likes
·
0 Votes
·
0 Comments
·
Awesome thanks a LOT Raymond, it seems to work without errors!
If i well understand the code, this customized function will look for active members based on replies counts only instead of topics and replies by default ? right ? If i chance the duration parameter for example for 365 then i ll get most active users in the last year ?
·
Tuesday, 09 February 2021 18:24
·
0 Likes
·
0 Votes
·
0 Comments
·
That is correct HMED.
·
Tuesday, 09 February 2021 18:43
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post