Version: , by (Guest)
Developer Last Online: Jan 1970
Version: Unknown
Rating:
Released: 08-24-2000
Last Update: Never
Installs: 0
No support by the author.
Here is an update to my stars hack - this one allows you different colored stars for admins/moderators
edit showthread.php
find:
Code:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");
If you have installed the avatar hack, this line will be modified. Just look for ' $userid=$post[userid]; ' and the line listed above will be 3-4 lines below that.
Edit that line listed above and add
Code:
usergroupid,
after the "SELECT" in that line. Make sure there is a space between the word you added and "SELECT". Make sure there is a comma after the word you added and before the next. It looks like this:
// --- Stars Hack by rangersfan
$stars = "";
$s_usergroup = $userinfo[usergroupid];
$moderator=$DB_site->query_first("SELECT usergroupid FROM forumpermission WHERE usergroupid = $s_usergroup AND canadminedit=1");
if ($moderator[usergroupid] == $s_usergroup) // This is a Normal Mod!
{
$starsgif = "<img src=\"images/star2.gif\" border=\"0\" width=\"15\" height=\"15\">";
}
else if ($s_usergroup==6) // This is an Admin!
{
$starsgif = "<img src=\"images/star2.gif\" border=\"0\" width=\"15\" height=\"15\">";
}
else if ($s_usergroup==5) // This is a SuperMod!
{
$starsgif = "<img src=\"images/star2.gif\" border=\"0\" width=\"15\" height=\"15\">";
}
else
{
$starsgif = "<img src=\"images/star.gif\" border=\"0\" width=\"15\" height=\"15\">";
}
if ($userpostcount > 1999)
{ $stars .= $starsgif . $starsgif . $starsgif . $starsgif . $starsgif; }
elseif ($userpostcount > 999)
{ $stars .= $starsgif . $starsgif . $starsgif . $starsgif; }
elseif ($userpostcount > 399)
{ $stars .= $starsgif . $starsgif . $starsgif; }
elseif ($userpostcount > 99)
{ $stars .= $starsgif . $starsgif; }
elseif ($userpostcount > 19)
{ $stars .= $starsgif; }
if ($stars == "")
{
$stars .= "<br>";
}
else
{
$stars .= "<br><br>";
}
// - Stars Hack
You need to supply your own stars names "star.gif" and "star2.gif". "star2.gif" is for admins/moderators. Put them in forums/images.
To modify how many stars correspond to how many posts you will need to change the if ($userpostcount > ..) parts. If you don't want stars, but galagas or such, change the parts that say '$stars .= $starsgif . $starsgif . $starsgif . $starsgif . $starsgif;' to something like '$stars .= (path to my image for x number of posts);'
Edit the postbit template and put $stars where you want them to appear.
[Edited by freddie on 11-04-2000 at 04:56 PM]
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
Hm... I've run into another problem, and I'm not quite sure what's wrong. I changed the code a little so if the user is Admin/Mod it automatically gives them 5 yellow stars, and if it's just a regular user, it gives them blue stars depending on how many posts they have. For some reason though, it's only giving the Administrator the yellow stars, and not the moderators (who are actually Super Moderators). Does it not work with Super Moderators?
I have installed this hack and it works great! thanks a lot.
But I want to have it do mods get 9 silver stars and supper mods get 9 gold stars and admins get 10 gold
how can I do this? I have beed trying and i can't get it to work.
Con_Man I have changed the code above and if check you will see it now has sections of Mod/SuperMod and Admin. Just put the stars you want for each into each section.
I will optimize the SQL in this hack when v2.0 is released if there are no stars in v2.0 by default.
Throughout the entire showthread.php file I did not find
Code:
$userinfo=$DB_site->query_first("SELECT userid,email,username,usertitle,signature,showemail,homepage,icq,aim,yahoo,joindate,posts FROM user WHERE userid=$userid");