Updated for V3 credit to Original Author
This mod shows the usernames in groups colour. You can change the colours in the config.php
First we add in backend/functions.php
At bottom before?>
in same file
replace with
In backend/config.php add
Here are the changes i noticed
in account-details.php find
replace with
in account.php find
replace with
in blocks/newestmemberblock.php find
replace with
blocks/useronline.php block
replace with
in memberlist.php
replace with
in shoutbox.hp
replace with
find
replace with
in torrent-completed.php
replace with
in forums.php find
replace with
find
replace with
find
replace with
find
replace with
find
replace with
Add images in images folder
Note
Now, to put in action this modification, you must add the class_user function in every place where you see user name.
For example you must change:
$user["username"] to class_user($user["username"]) or
htmlspecialchars($user["username"]) to class_user($user["username"]) or
$arr[username] to class_user($arr[username]) or
$CURUSER["username"] to class_user($CURUSER["username"])
and so on...
if this causes errors try using this, this example uses $row
This mod shows the usernames in groups colour. You can change the colours in the config.php
First we add in backend/functions.php
At bottom before?>
//===| Start class_user function
function class_user($name)
{
global $site_config;
$a ="SELECT class, donated, warned, enabled FROM `users` WHERE username ='".$name."'";
$b = SQL_Query_exec($a);
$c = @mysqli_fetch_row($b);
switch ($c[0])
{
case 7: // Administrator
$col = "".$site_config["administrator_color"]."";
break;
case 6: // Super Moderator
$col = "".$site_config["super_moderator_color"]."";
break;
case 5: // Moderator
$col = "".$site_config["moderator_color"]."";
break;
case 4: // Uploader
$col = "".$site_config["uploader_color"]."";
break;
case 3: // VIP
$col = "".$site_config["vip_color"]."";
break;
case 2: // Power User
$col = "".$site_config["power_user_color"]."";
break;
case 1: // Member
$col = "".$site_config["member_color"]."";
}
if($c[1] > 0) {
$donor = "<img src='".$site_config[SITEURL]."/images/donor.png' title='Donor' border='0'>";
} else { $donor = ""; }
if($c[2] == "yes") {
$warned = "<img src='".$site_config[SITEURL]."/images/warn.png' title='Warned' border='0'>";
} else { $warned = ""; }
if($c[3] == "no") {
$disabled = "<img src='".$site_config[SITEURL]."/images/disabled.png' title='Disabled' border='0'>";
} else { $disabled = ""; }
return unesc("<font color='".$col."'>".$name."</font>".$donor."".$warned."".$disabled."");
}
//====| End class_user functionin same file
echo "<a href='account-details.php?id=$row[owner]'>$row[username]</a>";
replace with
echo "<a href='account-details.php?id=$row[owner]'>".class_user($row[username])."</a>";In backend/config.php add
// Color of the Groups
$site_config['administrator_color'] = '#FF0000'; // Administrator
$site_config['super_moderator_color'] = '#00C000'; // Super Moderator
$site_config['moderator_color'] = '#007F00'; // Moderator
$site_config['uploader_color'] = '#00ABA6'; // Uploader
$site_config['vip_color'] = '#FF5E00'; // VIP
$site_config['power_user_color'] = '#BD8B00'; // Power User
$site_config['member_color'] = '#856A00'; // MemberHere are the changes i noticed
in account-details.php find
<?php echo T_("USERNAME"); ?>: <?php echo htmlspecialchars($user["username"])?><br />
replace with
<?php echo T_("USERNAME"); ?>: <?php echo class_user($user["username"])?><br />in account.php find
<b><?php echo T_("USERNAME"); ?>:</b> <?php echo $CURUSER["username"]; ?><br />
replace with
<b><?php echo T_("USERNAME"); ?>:</b> <?php echo class_user($CURUSER["username"]); ?><br />in blocks/newestmemberblock.php find
echo "<li><a href='account-details.php?id=$row[id]'>$row[username]</a></li>\n";
replace with
echo "<li><a href='account-details.php?id=$row[id]'>" . class_user($row["username"]) . "</a></li>\n";blocks/useronline.php block
echo "<li><a href='account-details.php?id=$row[id]'>$row[username]</a>".($i < $n ? ", " : "")."</li>\n";;
replace with
echo "<li><a href='account-details.php?id=$row[id]'>" . class_user($row[username]) . "</a>".($i < $n ? ", " : "")."</li>\n";;in memberlist.php
print("<tr><td class='table_col1' align='left'><a href='account-details.php?id=$arr[id]'><b>".class_user($arr[username])."</b></a>" .($arr["donated"] > 0 ? "<img src='$site_config[SITEURL]/images/star.png' border='0' alt='Donated' />" : "")."</td>" .
replace with
print("<tr><td class='table_col1' align='left'><a href='account-details.php?id=$arr[id]'><b>$arr[username]</b></a>" .($arr["donated"] > 0 ? "<img src='$site_config[SITEURL]/images/star.png' border='0' alt='Donated' />" : "")."</td>" .in shoutbox.hp
$query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='".$CURUSER['username']."' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30";
$query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='" . class_user($CURUSER["username"]) . "' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30";
replace with
$query = "SELECT COUNT(*) FROM shoutbox WHERE message=".$_POST['message']." AND user='" . class_user($CURUSER["username"]) . "' AND UNIX_TIMESTAMP('".get_date_time()."')-UNIX_TIMESTAMP(date) < 30";find
echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent"><b>'.$row['user'].':</b></a> '.nl2br(format_comment($row['message']));
replace with
echo '</td><td style="font-size: 12px; padding-left: 5px"><a href="'.$site_config['SITEURL'].'/account-details.php?id='.$row['userid'].'" target="_parent">'.class_user($row['user']).':</b></a> '.nl2br(format_comment($row['message']));in torrent-completed.php
<td class="table_col1"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><?php echo $row["username"]; ?></a></td>
replace with
<td class="table_col1"><a href="account-details.php?id=<?php echo $row["id"]; ?>"><?php echo class_user($row["username"]); ?></a></td>in forums.php find
$username = "<a href='account-details.php?id=$userid'>$arr[username]</a>";replace with
$username = "<a href='account-details.php?id=$userid'>".class_user($arr['username'])."</a>";find
$author = "<a href='account-details.php?id=$topic_userid'>$arr[username]</a>";replace with
$author = "<a href='account-details.php?id=$topic_userid'>".class_user($arr['username'])."</a>";find
$lpusername = "<a href='account-details.php?id=$lpuserid'>$arr[username]</a>";replace with
$lpusername = "<a href='account-details.php?id=$lpuserid'>".class_user($arr['username'])."</a>";;find
$lpauthor = "<a href='account-details.php?id=$topic_userid'>$arr[username]</a>";replace with
$lpauthor = "<a href='account-details.php?id=$topic_userid'>".class_user($arr['username'])."</a>";find
$lastposter = htmlspecialchars($user_arr['username']);replace with
$lastposter = class_user($user_arr["username"]);Add images in images folder
Note
Now, to put in action this modification, you must add the class_user function in every place where you see user name.
For example you must change:
$user["username"] to class_user($user["username"]) or
htmlspecialchars($user["username"]) to class_user($user["username"]) or
$arr[username] to class_user($arr[username]) or
$CURUSER["username"] to class_user($CURUSER["username"])
and so on...
if this causes errors try using this, this example uses $row
" . class_user($row[username]) . "



