Ok I have seen that users have been using the sql calls in alot of files just to collect class colors and when they have to change something it means having to go through all the different files to add new classes into it so it matches. So i made a function from the code you have all been using so it can be called from any file then theres only functions.php to change anytime u add something new.
Updated with star and warned icon!
In functions.php add... note to change to match your current classes
:)
more examples login block....
function class_user($name)
{
global $site_config;
$a ="SELECT class, donated, warned FROM `users` WHERE username ='".$name."'";
$res = mysql_query($a);
$classy = @mysql_fetch_row($res);
switch ($classy[0]) {
case 8: // SYS:
$col = "#15CFCD";
break;
case 7: // ADMINISTRATORSYS:
$col = "#ff0000";
break;
case 6: // Administrator
$col = "teal";
break;
case 5: // Super Moderator
$col = "#3300CC";
break;
case 4: // Moderator
$col = "#006600";
break;
case 3: // VIP
$col = "#FFFF00";
break;
case 2: // Uploader
$col = "#33FF33";
break;
default: // User
$name = $name;
}
if ($classy[1]>0){
$star="<img src='".$site_config[SITEURL]."/images/star.gif' alt='donated' border='0'>";
}else{
$star="";
}
if($classy[2]=="yes"){
$warn="<img src='".$site_config[SITEURL]."/images/warn.gif' alt='warned' border=0>";
}else{
$warn="";
}
return unesc("<font color='".$col."'>".$name."".$star."".$warn."</font>");
}
Now all you need to do is for any "username" code for example $row['user'] in shoutbox would now be
'.class_user($row['user']).'
or
".class_user($row['user'])."
depending on whether ' or " starts the echo or print
begin_block("".class_user($CURUSER[username])."");
torrenttable....
echo "<a href='account-details.php?id=$row[owner]'>".class_user($row[username])."</a>";