Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Top Posters per Forum (shown in forumdisplay) Details »»
Top Posters per Forum (shown in forumdisplay)
Version: 1.00, by Gary King Gary King is offline
Developer Last Online: Jun 2020 Show Printable Version Email this Page

Version: 3.0.1 Rating:
Released: 06-06-2004 Last Update: Never Installs: 15
 
No support by the author.

What does this hack do?

This hack shows the top poster in each forum, in the forumdisplay template (so when viewing the forum, you can see the top poster for that forum).

The line that displays the top poster for the forum is in the template, so you can move it anywhere you want it to show up!

View screenshots for examples!

Instructions

Open forumdisplay.php and find
PHP Code:
eval('print_output("' fetch_template('FORUMDISPLAY') . '");'); 
add above (change $topposterno to how many top posters per forum you want to show)
PHP Code:
// Top Posters Per Forum hack v1.0 by Gary W.
$topposterno 5;

$topposter $DB_site->query("SELECT COUNT(post.postid) AS posts,userid,username FROM " TABLE_PREFIX "post AS post
    LEFT JOIN " 
TABLE_PREFIX "thread AS thread ON post.threadid = thread.threadid
    LEFT JOIN " 
TABLE_PREFIX "forum AS forum ON forum.forumid = thread.forumid
    WHERE forum.forumid=
$forumid
    GROUP BY userid ORDER BY posts DESC LIMIT 0, 
$topposterno");

$topposterno2 $topposterno;

while (
$top $DB_site->fetch_array($topposter))
{
  
$topposterno--;

  if (
$topposterno == 0)
  {
    
$and "and ";
    
$final "!";
  }
    
    eval (
'$topposters .= "' $comma fetch_template('topposters') . '";');
  
//eval ("\$topposters .= \"" . $comma . fetch_template("topposters"). "\";");
  
$comma ",";

open FORUMDISPLAY template and find
HTML Code:
$navbar
below add
HTML Code:
<td><span class="smallfont">This forum's top $topposterno2 posters are: $topposters</span></td>
add a template named topposters with following content
HTML Code:
$and<b><a href="member.php?$session[sessionurl]u=$top[userid]">$top[username]</a></b> with <b>$top[posts]</b> posts$final
OPTIONAL STEPS

If you want it to work faster (on large boards especially),
then run the following query on your database:
[sql]
ALTER TABLE post ADD INDEX (username);
[/sql]

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-01-2004, 11:35 PM
Reeve of shinra's Avatar
Reeve of shinra Reeve of shinra is offline
 
Join Date: Oct 2001
Location: NYC
Posts: 1,896
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

How many queries does this add?
Reply With Quote
  #13  
Old 09-26-2004, 11:16 AM
Overlord Overlord is offline
 
Join Date: May 2002
Location: Australia
Posts: 38
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there any way someone can mod this hack into the vb2 style of showing a forums top posters? I want this hack but it doesn't really fit the way it is, I would prefer that it would make the forums 'replies' on the forumhome a link, so when you click it a vb3 style dropdown box opens with the top however many posters.

I could possibly mod this hack myself to do what I want, but I'm fairly new to this and I'm not sure if A: It'll work o.o, or B: the loading times that it will add to the forumhome.
Reply With Quote
  #14  
Old 09-29-2004, 09:11 PM
VriendP VriendP is offline
 
Join Date: Feb 2003
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think you could make this code more efficient by grabbing a template once, instead of grabbing it for each user in the list...

But I'm not sure if that would reduce the amount of queries though, just seems logical.

Nice hack, I'll play with it!
Reply With Quote
  #15  
Old 10-30-2004, 09:24 AM
Neutral Singh's Avatar
Neutral Singh Neutral Singh is offline
 
Join Date: Sep 2004
Location: Sikh Philosophy Network
Posts: 545
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gary, you are wonderful !!
Reply With Quote
  #16  
Old 05-22-2005, 05:39 PM
hollyboy's Avatar
hollyboy hollyboy is offline
 
Join Date: Mar 2004
Posts: 318
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

would it be possible to see the top posters per forum all on one page?
Reply With Quote
  #17  
Old 06-05-2005, 10:02 PM
vktechnology vktechnology is offline
 
Join Date: Jul 2004
Location: London, England
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

good hack, i just install
Reply With Quote
  #18  
Old 01-27-2006, 06:20 PM
zylstra zylstra is offline
 
Join Date: Aug 2004
Posts: 144
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Gary, would you port this to 3.5 please?

Thanks.
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:16 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.07522 seconds
  • Memory Usage 2,279KB
  • Queries Executed 22 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_html
  • (2)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (8)post_thanks_box
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete