PDA

View Full Version : Statistics Modifications - User Rank by Posts


Farcaster
07-12-2007, 10:00 PM
This is a quick modification I made for my own forum to rank all of my users by the number of posts they've made and make that ranking available on the postbit and profile pages. No extra queries are added, except for the cron job that runs to update the statistics at an interval you specify, which will add 4 queries when called.

This hack was only tested on 3.6.5, but it may work on 3.5.x as well. If anyone confirms that, let me know.

Installation Instructions
- 1 XML upload
- 1 File upload
- 2 optional template modifications

1. Upload the file rank_users_by_post.php to your forum/includes/cron directory.
2. Use the Product Manager to import the product file product-rah_user_rank_by_posts.xml
3. By default, user ranks will be updated once per hour. If you want to change the frequency of the updates, go into the Schedule Task Manager and find the job "Update User Post Ranks". You may change this script to run as often or as little as you like. You can run it manually to get an idea of how long it will take to run, which give you a good idea of how frequently you can safely run it. (On my forum, it runs almost instantaneously with over 2000 members.)
4. If you want to add the poster's rank to each post, you can add it anywhere by referencing the $post[postrank] variable. On my forums, I added it just under the users post count by finding:

<div>
$vbphrase[posts]: $post[posts]
</div>And below that, add:

<if condition="$post[postrank]"><div><b>$vbphrase[rah_urbp_rank]: #$post[postrank]</b></div></if>5. You can also reference the rank on the profile page. On my forums, I added it just above the user's last activity by editing the MEMBERINFO template and finding:

<if condition="$show['lastactivity']">And above that, add:

<if condition="$userinfo[postrank]"><div>$vbphrase[rah_urbp_rank]: #$userinfo[postrank]</div></if>And that's all there is to this one. It is a very simple hack, but I figured I'd share.

Standard (Global) Phrases Used:
rah_urbp_rank = "Poster Rank"

Known Bugs:
None.

Revision History:
v1.0.0 - Initial Release

Farcaster
07-13-2007, 04:17 AM
One albeit obvious note, ranks will not show up until after the first time the cron job is run. If you want them to show up right away, you need to run the cron job manually.

FreshFroot
07-13-2007, 05:37 AM
hmm I'll try it out and see how it does.

thanks for the hack :D

4x4 Mecca
07-13-2007, 05:48 AM
installed :)

Hornstar
07-13-2007, 06:57 AM
So it says what rank they are in the postbit, I like ^^

nice work.

projectego
07-13-2007, 08:14 AM
Now that's pretty cool! :D

* projectego clicks install

TTG
07-13-2007, 12:13 PM
Thanks Farcaster .. nice and simple but useful. Just like the wife :D

Clicked install

Quantnet
07-13-2007, 07:11 PM
why nobody thought of this before. Thanks Robert !

Spank
07-13-2007, 08:30 PM
i thought you could do this in vBulletin as standard?

Farcaster
07-13-2007, 09:32 PM
i thought you could do this in vBulletin as standard?

Not that I found. You can do a list of members by the number of posts they've made, but stock vB doesn't have a way to show where they fall in relation to everyone else in post count in the profile and postbit. My thought was, who doesn't want to be #1? Or in the top 10? Perhaps it could help spur some healthy competition :)

Spank
07-13-2007, 11:06 PM
I see what you mean, numbered ranks. Nice idea. ^_^

alessai
07-14-2007, 12:48 AM
great instaled.....

2impulsiv
07-14-2007, 12:56 AM
Love your work Farcaster....


Cheers..

:)

aakhan136
07-14-2007, 04:07 PM
Thanks

johnrizz
07-14-2007, 05:45 PM
This is a cool hack, thanks!

Farcaster, I have a question! On the bottom of this pic I see a mod that I would love to have. haha! Its the Distance to Member: Did you make this or do you know were I can get it?

https://vborg.vbsupport.ru/attachment.php?attachmentid=66909&d=1184303302

Andyucs
07-14-2007, 06:03 PM
Very nice tnx

Farcaster
07-15-2007, 02:12 AM
Distance to Member: Did you make this or do you know were I can get it?

Yes, it is part of a larger hack I wrote. My site features a "Player Registry" that members can search for other members within a certain radius of their location and by a number of other criteria. Its proprietary, I fear, and not one I have published publicly.

Majest
07-30-2007, 06:42 AM
One albeit obvious note, ranks will not show up until after the first time the cron job is run. If you want them to show up right away, you need to run the cron job manually.

How would one do that?

BigDog56
07-30-2007, 08:05 PM
Got it installed, works as advertised! Thank you!

ymy
07-31-2007, 09:06 AM
installed and work fine

Thanks

Ymy

.

alessai
08-15-2007, 08:09 PM
can the members ranked only for their number of threds in future editions?

vspro
08-16-2007, 12:11 AM
* installed

And i hav a idea:
We'll have 5 top poster and they have other rank images at postbit ??
Look like the Gunbound game online ?
may it comes true ?
ex :
#1 : img 1
#2 -> # 4 : img 2
#5 : img 3
and it work w User Rank Manager from AdminCP

RaceJunkie
08-22-2007, 10:03 PM
How does it come up with the ranks?

Farcaster
08-23-2007, 04:46 PM
How does it come up with the ranks?
It looks at the post count of each user.

Jikdor
11-24-2007, 11:43 PM
Nice, installed.

charles abiola
12-06-2007, 03:46 AM
Anybody know which template for this code:

Code:
<div>
$vbphrase[posts]: $post[posts]
</div>

Farcaster
12-06-2007, 11:13 PM
postbit

apiasto
12-07-2007, 03:03 AM
nice addition,thnx

Raptor
07-16-2008, 03:56 PM
does this work with vb 3.7.2 ?

charles abiola
07-19-2008, 03:07 PM
Any update for this hack to work with 3.7.2?

charles abiola
07-19-2008, 03:11 PM
I test it. The answer is yes. It works with 3.7.2.

Jezlad
08-09-2008, 08:43 AM
Can this be added to the members list at all?

pheyz
09-03-2008, 12:28 AM
thanks!

zombietom
09-09-2008, 06:41 PM
Great hack ! My forum users are loving it! thanks

pakdi
09-11-2008, 05:04 AM
user rank work in vb 3.7.3 ?

Quantnet
09-11-2008, 06:20 AM
yes. it works on mine

edytwinky
01-29-2009, 10:06 PM
Does this work on 3.7.4?

Edit: Yes It Does.

iou1
01-31-2009, 05:28 PM
I've installed this but I'm curious where I find it in my ACP?

All these coders always put where to install things and then uploading the XML but then never tell us where to find it! My eyes hurt, please spare me and just tell me what it's called in the ACP or where it can be found?

Thanks!

iou1
01-31-2009, 05:29 PM
Snap! Finally! NM. ;)

Muzza
02-24-2009, 11:23 PM
Does this work on 3.7.4?

I noticed when I upgraded from 3.6.8 to 3.7.4 the posting ranks disappeared?

Is there something I can do to fix that?

john102774
06-25-2009, 03:45 PM
*Installed

Thank you

charles abiola
06-26-2009, 05:50 AM
Does this work on 3.7.4?

I noticed when I upgraded from 3.6.8 to 3.7.4 the posting ranks disappeared?

Is there something I can do to fix that?
I have the same problems too. Any fix for this.