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.
There appears to be something wrong with the Database please e-mail the Technical Staff!
Something along these lines!
Couldn't you release a New Hack that has everything needed in it! And for 1.1.4 because I can't upgrade for some reasons my templates hae been changed and it won't do it!
Templates will not stop you from being able to upgrade. Sorry not really a valid excuse.
The only problems being encountered are if you have an older version of MySQL, the code needs to be changed a little. If your PHP version is older than 3.0.9 the new script won't work either.
Or if you have a heavily hacked board you may have to back out some of the hacks.