Back to vBulletin 3.0 Add-Ons

Top Posters per Forum (shown in forumdisplay)
Mod Version: 1.00, by Gary King

This modification is in the archives.
vB Version: 3.0.1 Rating: (0 vote - 0 average) Installs: 15
Released: 07 Jun 2004 Last Update: Never Downloads: 1
Not Supported  

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 Query: (how to run queries)
ALTER TABLE post ADD INDEX (username);

Download

No files for download.

Screenshots

 

Similar Mods

Top Posters per Forum (shown in forumdisplay) vBulletin 2.x Full Releases

vblts.ru supports vBulletin®, 2022-2024