vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Top Posters per Forum (shown in forumdisplay) (https://vborg.vbsupport.ru/showthread.php?t=65916)

Gary King 06-06-2004 10:00 PM

Top Posters per Forum (shown in forumdisplay)
 
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]

lifesourcerec 06-07-2004 12:24 AM

Thanks! Now, is there a way to put it in a table (something simple like the "attached thumbnails" box). would make them look more organized.

Gary King 06-07-2004 12:35 AM

I'm not one for cosmetics; so if someone wants to give some HTML code on where it should go, then be my guest, and please share it as well :) I just provide the functionality :p

lifesourcerec 06-07-2004 12:40 AM

Installed it without problems :)

MindTrix 06-07-2004 05:46 AM

Nice one Gary ;) Thanks for releasing

lifesourcerec 06-07-2004 10:26 PM

Removed this hack as it does a number on server load.

HakkieDEV 06-13-2004 05:31 PM

Quote:

Originally Posted by lifesourcerec
Removed this hack as it does a number on server load.

I agree, also installed this hack, but even with the database fix it created too much server load.

Photon 06-19-2004 11:03 AM

I installed it but I removed it because it doesn't look nice for my style..

dubumb 07-18-2004 01:53 AM

wow thanks... This is such a great hack... Thank you so much!!!!

SmartGnome 08-01-2004 06:00 PM

Thanks for the hack, install clicked........ and now is the time to play with some cosmetics here :laugh:


All times are GMT. The time now is 03:10 PM.

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.01053 seconds
  • Memory Usage 1,747KB
  • 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
  • (3)bbcode_html_printable
  • (2)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)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