How to get "TOP POSTER" per month

Started by SMiFFER, January 05, 2022, 02:58:13 AM

Previous topic - Next topic

SMiFFER

Is there a function that I have not found yet or, if not, a mod that does the following:

- determine how many posts all users have made from %startdate% to %enddate%, preferably a month
- list the top 10, or, if not, show the top poster of that time period

Constructive and helpful comments highly appreciated. TIA.
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!


Arantor

Run this in phpMyAdmin:

SELECT mem.real_name, COUNT(m.id_msg) AS message_count
FROM smf_messages AS m
JOIN smf_members AS mem ON (m.id_member = mem.id_member)
WHERE FROM_UNIXTIME(m.poster_time) BETWEEN '2021-12-01 00:00:00' AND '2021-12-31 23:59:59'
GROUP BY m.id_member ORDER BY message_count DESC;

Substitute the start and end dates/times as desired. This will give you the list of all posters in that timeframe, ordered by most posts first.

This way you can pull whatever poster stats from whatever period you like without waiting on someone to code a mod for it.

You can also add conditions, e.g. restrictions to boards by adding to the WHERE clause with AND, e.g. AND m.id_board IN (1, 2, 3) to limit it to boards 1, 2, 3, or even AND m.id_board NOT IN (1, 2, 3) to restrict it to posts not in those boards, e.g. if you wanted to restrict the recycling forum.
Holder of controversial views, all of which my own.


SMiFFER

Quote from: shadav on January 05, 2022, 03:44:59 AMa search in the Modifications for top poster yields these three
https://custom.simplemachines.org/index.php?mod=1231
https://custom.simplemachines.org/index.php?mod=4227
https://custom.simplemachines.org/index.php?mod=4263
Thanks. And I looked at all three of them

1231 is for 2.0
4227 is for 2.0.15 
4263 is for 2.0.17

I am inmidst of updating to 2.1, so all three are "not for me". Pity.
Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

shadav

Quote from: SMiFFER on May 11, 2022, 07:02:38 PM
Quote from: shadav on January 05, 2022, 03:44:59 AMa search in the Modifications for top poster yields these three
https://custom.simplemachines.org/index.php?mod=1231
https://custom.simplemachines.org/index.php?mod=4227
https://custom.simplemachines.org/index.php?mod=4263
Thanks. And I looked at all three of them

1231 is for 2.0
4227 is for 2.0.15
4263 is for 2.0.17

I am inmidst of updating to 2.1, so all three are "not for me". Pity.


well seeing as you posted this in the 2.0.x that was what I looked up for
though knowing doug i'd say just keep an eye out on  his mods, they'll get updated eventually

Doug Heffernan

Quote from: SMiFFER on May 11, 2022, 07:02:38 PM4227 is for 2.0.15 
4263 is for 2.0.17

I am inmidst of updating to 2.1, so all three are "not for me". Pity.

I have added my 2 mods you quoted above on my to do list to get them updated later for 2.1.x.
 

Doug Heffernan

#6
Quote from: SMiFFER on May 11, 2022, 07:02:38 PM4263 is for 2.0.17

I just updated this mod to be compatible with the 2.1.x. The TopForumStats21 package is compatible with the 2.1.x version.

Doug Heffernan

Quote from: SMiFFER on May 11, 2022, 07:02:38 PM4227 is for 2.0.15 

I just updated this mod as well to be compatible with the 2.1.x. The BoardStats21 package is compatible with the 2.1.x version.

Advertisement: