XF 2.1 Best practice User of the Month

Robert9

Well-known member
There are several add-ons to have and show The user of the month in an forum.
For XF2 there is a free add-on from the one who has left us with the LD Beta, maybe we will see a finished version one day?,
probably he just selects a list from the tables, maybe with a cache, maybe not.

Then we have the one from AndyB with a cron job, that probably do the same, but not in real time with cron-jobs.

For XF1 i had one a paid one with the name rolling post counter? with many fields in xf_table.


All of them have something:
The first one selects in real time, i guess. The lists are always correct.
AndyB has less queries, but the result may differ from the real counts.
The paid one, i mentioned had more counters like this month, last month, the month before. Maybe needed, maybe not, it saves the numbers not in one field, but many fields in xf_user.

Many programers just add fields to the tables instead using one for some vars. I am still not shure if this is needed. When i did a custom add-on for SEO, i put everything in xf_thread.seo. To use the data, it was needed to use an array in the templates $seo.title, $seo.description and so on. Others dont need an array, but use a lot of fields.

Anyway. My questions are:
  • When do you use some fields for a table, when it is enough to have one or less fields than vars? (I guess, you dont need fields, when you dont sort.)?
  • How we could use a cache instead? As long there is no new post since the last select, we dont need new select from the tables, right?
  • What do think about SELECTING the top poster of the month in real time or do it with a cron job every hour/every day?
  • And maybe it is better to add an extra table for things like that? Here we can mix the style. New posts? => count++ in this table, if user is there. Plus a cron job every night, helps to have a correct list, but with problems, when less posts, beginning of month or at the end of the list.
 
While you can exclude, forums, users, usergroups it is maybe a good idea to use also the wordcount from XON to count only posts with at least x words.
 
Back
Top Bottom