PDA

View Full Version : Top Posters per Forum (shown in forumdisplay)


lifesourcerec
06-06-2004, 03:07 PM
Will this ever be available for vB3? It is very handy for contests.

all-the-vb
06-13-2004, 08:57 AM
that's its very easy
i wright code to my friend in last week.

to install:

1. open forumdisplay.php file

find :
$lastread = $bbuserinfo['lastvisit'];
}

after that add:

$topposter='';
$top = $DB_site->query("
SELECT count(post.postid) AS total_post,count(thread.threadid) AS total_thread, user.userid,user.username,user.joindate from " . TABLE_PREFIX . "user AS user
LEFT JOIN " . TABLE_PREFIX . "post AS post ON(user.userid = post.userid)
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON(post.threadid = thread.threadid) where
thread.forumid='$forumid'
group by user.userid order by total_post DESC LIMIT 5");
$counteruser=0;
while ($topp = $DB_site->fetch_array($top))
{
$counteruser++;
$topp['joindate'] = vbdate($vboptions['dateformat'], $topp['joindate'], true);
eval('$topposter .= "' . fetch_template('forumdisplay_topposter') . '";');
}

2. open (forumdisplay) template


find:
$navbar


after that add :
<br />
<table border="0" cellspacing="$stylevar[cellspacing]" cellpadding="4" class="tborder" width="$stylevar[tablewidth]">
<tr width="100%" class="alt1">
<td class="thead" width="50%" align="$stylevar[left]">أفضل خمس أعضاء</td>
<td class="thead" width="50%" align="$stylevar[left]">المشاركات</td>
$topposter
</table>
<br />

3) add a new templates:
name : forumdisplay_topposter

put in :

<tr>
<td class="alt1Active" align="$stylevar[left]" width="80%" id="u$topp[userid]"><span class="smallfont">$counteruser)
<a href="member.php?$session[sessionurl]u=$topp[userid]">$topp[username]</a><br />تاريخ تسجيله : $topp[joindate]</span></td>
<td class="alt1Active" width="20%"><span class="smallfont">$topp[total_post] (<a href="search.php?do=finduser&u=$topp[userid]&f=$forumid">عرض هذه المشاركات</a>)</span></td>


:ermm: sorry for my english>