PDA

View Full Version : How to exclude admin from top 10


JohnBee
12-18-2004, 11:24 PM
I though that the hidden status would do it but I noticed that
the administrator is in the top 10 list.

is there any way to exclude the admins from the top posters list?

JohnBee
04-29-2005, 10:29 AM
I take this as a no?

WetWired
04-29-2005, 06:02 PM
What top posters list?

DRJ
04-29-2005, 06:54 PM
just add the condition to your query

WHERE usergroupid <> #

Where # is the usergroup id for admin.

JohnBee
04-30-2005, 12:47 AM
Wow! great
so here on my forum I have this:
Congratulations to JohnBee with 4878 posts!

so I would put this condition where?
in a template of one of my .php files?

Sebastian
04-30-2005, 01:33 AM
anwser WetWired's question..

JohnBee
04-30-2005, 02:48 AM
Ah.

This one, its so small I though it came by default with vBulletin :lick:

// Top Poster (Template Mod Style)
// Original: Lesane
// vB3 Re-Make: assassingod (ffdcsite)

Step one:
Open up the 'phpinclude_start' template and at the bottom, add:
if (THIS_SCRIPT == "index")
{
$topposter = $DB_site->query_first("
SELECT username,posts,userid
FROM " . TABLE_PREFIX . "user
ORDER BY posts DESC
LIMIT 1
");
}


Step 2:
Now in the FORUMHOME template, add anywhere you want:
<br />
<b>Top Poster:</b> <a href="member.php?$session[sessionurl]u=$topposter[userid]">$topposter[username]</a> (With $topposter[posts] posts!)

DRJ
04-30-2005, 03:04 AM
$topposter = $DB_site->query_first("
SELECT username,posts,userid
FROM " . TABLE_PREFIX . "user
WHERE usergroupid <> #
ORDER BY posts DESC
LIMIT 1
");

Replace # with the id you want to exclude.

JohnBee
04-30-2005, 03:07 AM
Awesome! it work beautifully!
thanks! .thumbsup.

Netdesignz
04-11-2006, 12:35 PM
How could I add a date range to this hack ? Anyone ? Help ...