MyBB Hacks

Full Version: Top Referrer In Forum Statistic
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
A simple plugin that displaying top referrer in forum statistic and displaying an image in postbit/classic and profile page for top referrer.

The image path: images/topref.gif

Additional variable:
postbit and postbit_classic:

Code:
{$post['mntref']}

member_profile:

Code:
{$mn_top_referrer}


Translation:
Spanish

Statistics:
[attachment=549]
Post Bit:
[attachment=547]
Profile:
[attachment=548]

Nice simple mod RateU Smile

I might suggest adding a secondary sort, eg by referrals, then by uid (or maybe registration date) since it's not exactly known what would happen with two people with the same number of referrals.  Not really an issue, but might help be a bit more consistent.
Maybe also stick an index on the referrals column when activating the plugin (or if you decide to sort by referrals then uid, make a composite index KEY(referrals,uid) ).  Alternatively, you could cache the user with most referrals.
Hope that helps, and thanks for sharing!
Thanks for the suggestion, Yumi Smile

I've tried using KEY in the referrals and uid columns (attachment updated in the first post).
Please tell me if I did it wrong, Yumi Biggrin
I see you've used a cache - very nicely done and well written RateU! Smile
Unfortunately, I don't know how updating the cache if the User Pruning task run, Yumi Oops
So, I use the Recount Statistics if the cache can't be updated by the reason and other reasons. Is it OK, Yumi?
There are ways to try to hook in, but I personally wouldn't bother - that feature isn't used too often, and you'd probably expect users with high amount of referrals not likely to be pruned.
It's all thanks to MyBB not implementing proper central handling functions...
Thanks, Yumi Smile
A little optional update Biggrin
Displaying an image in postbit/classic and profile page for top referrer.
This plugin looks pretty nice RateU (:

I don't like using ProStats for showing this kind of stuff so thanks for sharing it Biggrin
Thanks, Sama34 Smile

Well, if you want to use a complete statistics on forum index, probably you can try Overview.
It uses cache for displaying most of the statistics.

http://mods.mybb.com/view/overview-mybb-1-6
Pages: 1 2
Reference URL's