Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+6 votes
in Plugins by
edited by

Update: Here is the premium version of this plugin that brings new features and does not require a cronjob anymore: http://www.q2apro.com/plugins/best-users-pro


I announced the development on 14 Jun 2012, and now about 4 weeks later, after some fixes and several improvements, you get the new plugin :)

Download: Plugin: Best Users per Month (q2a-best-users-per-month)

Please check out the installation instructions!



Screenshot q2a-Plugin best-users-per-month

Running example: Matheforum Gute-Mathe-Fragen.de

This plugin creates a table "qa_userscores" in your database.
- you should create a monthly cronjob, check instructions.


Things that are missing:

  1. I could not figure out yet how to create the database table from initializing the plugin. For now you have to run the file create_table_qa_userscores.php solved (thanks gidgreen)
  2. The settings are not available in the admin interface. For now you have to change the settings in file qa-best-users-per-month-widget.php
  3. I still need to find the solution of how to add a subnavigation (Best Users) for the page. I know I need a layer.php but the things I tried were not successful. Created a "ticket" here. Solved. Updated to v1.1

Any feedback is welcome, as well as any improvements in the code (esp. adding admin options). You can fork me on github.

I hope you like it. All the best!


Before installing the plugin, please think about your point system (>Admin >Points). The points should not change over time - as the plugin stores the recent userpoints each month. → If you change userpoints later on, the userscores shown by the plugin could vary a lot. See: You should have a fix point system!


Q2A version: 1.5.1
Just installed this widget, but it looks different than the screenshot above...  in the screenshot there's just a little space between "Monat Wahlen" and the dropdown menu to choose a month. At my site there's a lot of space between these two... and at Gute-Mathe-Fragen.de you can click at title of the widget to go to the page, but at my site i can't... can you tell me if there's something wrong? Or is it by default this way and do i need to change some things? If yes, can you tell me what i have to change? Thanks :)
1. "it looks different than the screenshot above" → depends on your theme/css
2. "little space" → check margin and padding in CSS
3. "you can click at title of the widget to go to the page" → I implemented this a few weeks ago, to change this, open qa-best-users-per-month-widget.php, go to line 156, and change:

$themeobject->output('<div style="font-size:14px;margin-bottom:18px;"><b>'.$langActUsers.'</b> <span style="font-size:12px;">'.$monthName.'</span></div>');

$themeobject->output('<div style="font-size:14px;margin-bottom:18px;"><a href="http://www.domainofyoursite.com/bestusers"><b>'.$langActUsers.'</b></a> <span style="font-size:12px;">'.$monthName.'</span></div>');

6 Answers

0 votes

I never used cronjobs before, i'm afraid to do something wrong... below you see an example of cPanel cronjobs... can you tell me what to fill in exactly? Or do you have to call the cronjob.php by hand every 1st day of the month?

Is it possible to change settings from best user per month to best user per week?

Ps. I like this plugin, i think it's one of the best methods to keep your Q&A page active, specially when top users can earn a bonus every week/month! Keep up the good work!


Not implemented, I consider this for the PRO version.
Cool is it on sale on q2apro.com ? we are interested in buying it.
http://www.q2apro.com/plugins/best-users-pro (recent version with monthly and yearly best users)
Thank you Q2apro, i am afraid that it's not what i meant. what we are looking for in fact is a sorting of users based on weekly contribution ( points) not activity. i think this could be an extension to the best of month users plugin where sorting is going to be instead in the main page ( now it shows in sidebar widget)  and ranking would be on weekly basis. please see "users tab" on Stackoverflow for exemple. thank you !
0 votes

i'm from chinese, i like this plugin, so i used it, but there is sth bothered me


1、u can see that the title of 

how can i translate it into chinese



2、Monatliche Prämien: 1. Platz: 20 Euro | 2. Platz: 10 Euro

and how can i translate it into chinese,thanks for your job and wait for your answer


BTW:  i don't know what's cronjob, if i have no cronjob, what will happen or will not happen?

Do you have the latest files?

I updated the plugin yesterday. If you have already installed it, you need to get the following files:

qa-best-users-per-month-lang.php (there is one more line for translation)
qa-best-users-per-month-layer.php (this file will add a subnavigation!)
qa-plugin.php (needed)

-> you have to translate into Chinese in this file: qa-best-users-per-month-lang.php

edited by
ah I just saw that there was a language string missing in qa-best-users-per-month-page.php.

Please update this file!

In other words: Just update all files and transfer the translations you made to qa-best-users-per-month-lang.php
For the cronjob: If you don't know about cronjobs, just call the file qa-plugin/best-users-per-month/cronjob/cronjob.php every 1st day of each month (with your browser).

This will save the recent userpoints as userscores for the month.
thanks for your respond, the 2nd question have solved, but the 1st question: [QA_BEST_USERS_LANG/SUBNAV_TITLE]
in which file that i  can  translate it into chinese
Sorry, my fault. I forgot to upload the new language file.

Please update "qa-best-users-per-month-lang.php".

There was a language string missing:
// subnavigation on all users page
'subnav_title' => 'Monatsbeste', // best users of the month

Thanks for testing!
everythins is ok except the cronjob
i used shared host, there is no control panel, so i can't use cronjob.
now i add a link in the main nav only view by admin so that i can update the score easily!
thanks for your good job!
I am glad that you found a "cronjob workaround"!
0 votes
any other way to do the same thing as cronjob except input cronjob.php with browser?
With cronjobs you can call any file on your server time-based.

As far as I know, the only other chance is to call the php file manually. As I wrote: Saving the userpoints each month can be done manually, you just have to run the cronjob.php file.

Of course, you could rename the file if you are worried about security. Remember, the file only saves userscores if they do not exist yet. If userscores exist for this month, it will not save any data.
maybe u can add a link at the best users page, such as a button "update score", so that everyone can hit it to update the score or u can just allow admin to update the score by click the button.
as stated on top, I would like to see others to develop the admin section. Then the button you mentioned could be implemented :)

Until then, please bookmark cronjob.php and call it manually with your browser (don't forget to remove .htaccess from the folder).
+1 vote
when i changed the points get at the admin panel, everything is wrong,

such as

first, i update the score to the table,

then i changed one answer get 100 points to one answer get 1 point, everything is wrong!

so if u can add an option to update score without any condition
edited by
The plugin cannot recalculate points, it can *only* store userpoints in a table:

date | user | userpoints
2012-07-01 | Mai | 110

If you change userpoints later on, it will be not accurate for the recent month.

Let's say user "Mai" has 140 points at the moment. Then the plugin calculates:
2012-07-01 | Mai | 110
-> 140 - 110 = 30

and displays 30 points.

If you change your point system now (and you *reduce* points granted), and you recalculate points (>Admin >Stats >Recalculate Userpoints) - then let's say "Mai"'s points change from 110 to 85 userpoints:

The plugin will calculate:
2012-07-01 | Mai | 110
85 - 110 = -25

and displays -25 points.

General Solution: You should have a fix point system!

Solution for *your specific situation*:
1. delete table qa_userscores
2. go to >Admin >Plugins (this re-initializes the userscore data)

Hope that helps!
if i can only clean the table qa_userscores instead of delete it?
yes, this will have the same effect.

Don't forget to call the cronjob.php afterwards as this is saving the recent userpoints as userscores anew!
thanks, it's done!
+1 vote
I have installed the plugin but the site is very slow now and I would like to uninstall it. How should I do it?

Thank you in advance for any tips.
Delete the folder "qa-best-users", you find it in the folder qa_plugin.

Why is your site slow now, I am running this plugin with 1500 users and have no performance issues. Maybe something else is slowing down your installation.
It worked. Thank you for the fast response.

Will look into the plugin again in the near future. Maybe I'll find a great use for it then. Wonderful work, anyway.
The PRO version is caching all scores, your server will not "feel" it. You can get the premium plugin at http://www.q2apro.com/plugins/best-users-pro
0 votes

Hi i downloaded this plugin and when i click cronjob button through admin panel i am getting the message "cronjob could not run for this month"

Why is this happens?

I am quite sure you mean the free version, which is completely different from the PRO version. The PRO version does not need any cronjob. Please post your issue at the correct place: https://github.com/q2apro/q2apro-best-users-per-month-free/

And please hide / delete your "answer" here, as this is misleading. Thank you.
ok ;) @q2apro
No button to hide/delete the answer !!!!