vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Statistics Modifications - User Rank by Posts (https://vborg.vbsupport.ru/showthread.php?t=152103)

Farcaster 07-12-2007 09:00 PM

User Rank by Posts
 
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:

Code:

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

And below that, add:

Code:

<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:

Code:

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

Code:

<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 03: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 04:37 AM

hmm I'll try it out and see how it does.

thanks for the hack :D

4x4 Mecca 07-13-2007 04:48 AM

installed :)

Hornstar 07-13-2007 05:57 AM

So it says what rank they are in the postbit, I like ^^

nice work.

projectego 07-13-2007 07:14 AM

Now that's pretty cool! :D

[high]* projectego clicks install[/high]

TTG 07-13-2007 11:13 AM

Thanks Farcaster .. nice and simple but useful. Just like the wife :D

Clicked install

Quantnet 07-13-2007 06:11 PM

why nobody thought of this before. Thanks Robert !

Spank 07-13-2007 07:30 PM

i thought you could do this in vBulletin as standard?

Farcaster 07-13-2007 08:32 PM

Quote:

Originally Posted by Spank (Post 1290241)
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 :)


All times are GMT. The time now is 04:30 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01668 seconds
  • Memory Usage 1,737KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_code_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete