|
#1
|
|||
|
|||
Browse & details Anonymous Colours
So here we go
@include torrenttable we need to add the class Colours you will need to change this part to Code:
if ($variant == "index") if ($row['anonymous'] == 'yes') { $htmlout.= "<td align='center'> ".(isset($row["username"]) ? (($row["anonymous"] == "yes" && $CURUSER['class'] < UC_STAFF && $row['owner'] != $CURUSER['id']) ? " <i>".$lang['torrenttable_anon']."</i>" : "<b><font color='#" . get_user_class_color($row['class']) . "'> " . htmlspecialchars($row['username']) . "</b></a>") : "<i>(".$lang["torrenttable_unknown_uploader"].")</i>") . " </td>\n"; }else{ $htmlout .= "<td align='center'> " . (isset($row["username"]) ? ("<a href='userdetails.php?id=" . $row["owner"] . "'><b><font color='#" . get_user_class_color($row['class']) . "'> " . htmlspecialchars($row['username']) . "</b></a>") : "<i>(".$lang["torrenttable_unknown_uploader"].")</i>") . " </td>\n"; } Find Code:
users.username, Code:
users.username, users.class FROM @ the query add Code:
torrents.anonymous, Code:
users.username, users.class FROM Code:
if ($row['anonymous'] == 'yes') $uprow = "<i>Anonymous</i>"; $uprow = (isset($row["username"]) ? (($row["anonymous"] == "yes" && $CURUSER['class'] < UC_STAFF && $row['owner'] != $CURUSER['id']) ? " <i>".$lang['details_anon']."</i>" : "<b><font color='#" . get_user_class_color($row['class']) . "'> " . htmlspecialchars($row['username']) . "</b></a>") : "<i>{$lang['details_unknown']}</i>"); if ($owned) @include @config.php Before the End Tag Replace with Code:
define ('UC_USER', 0); define ('UC_POWER_USER', 1); define ('UC_VIP', 2); define ('UC_UPLOADER', 3); define ('UC_MODERATOR', 4); define ('UC_ADMINISTRATOR', 5); define ('UC_SYSOP', 6); define('UC_MIN', 0); define('UC_MAX', 6); define('UC_STAFF', 4); Replace with Code:
function get_user_class(){ global $CURUSER; return $CURUSER["class"]; } $class_names = array( UC_USER => 'User', UC_POWER_USER => 'Power User', UC_VIP => 'VIP', UC_UPLOADER => 'Uploader', UC_MODERATOR => 'Moderator', UC_ADMINISTRATOR => 'Administrator', UC_SYSOP => 'SysOp'); $class_colors = array( UC_USER => '8E35EF', UC_POWER_USER => 'f9a200', UC_VIP => '009F00', UC_UPLOADER => '0000FF', UC_MODERATOR => 'FE2E2E', UC_ADMINISTRATOR => 'B000B0', UC_SYSOP => '4080B0'); $class_images = array( UC_USER => $TBDEV['pic_base_url'].'class/user.png', UC_POWER_USER => $TBDEV['pic_base_url'].'class/power_user.png', UC_VIP => $TBDEV['pic_base_url'].'class/vip.png', UC_UPLOADER => $TBDEV['pic_base_url'].'class/uploader.png', UC_MODERATOR => $TBDEV['pic_base_url'].'class/moderator.png', UC_ADMINISTRATOR => $TBDEV['pic_base_url'].'class/admin.png', UC_SYSOP => $TBDEV['pic_base_url'].'class/sysop.png'); function get_user_class_name($class) { global $class_names; $class = (int)$class; if (!valid_class($class)) return ''; if (isset($class_names[$class])) return $class_names[$class]; else return ''; } function get_user_class_color($class) { global $class_colors; $class = (int)$class; if (!valid_class($class)) return ''; if (isset($class_colors[$class])) return $class_colors[$class]; else return ''; } function get_user_class_image($class) { global $class_images; $class = (int)$class; if (!valid_class($class)) return ''; if (isset($class_images[$class])) return $class_images[$class]; else return ''; } function valid_class($class) { $class = (int)$class; return (bool)($class >= UC_MIN && $class <= UC_MAX); } function min_class($min = UC_MIN, $max = UC_MAX) { global $CURUSER; $minclass = (int)$min; $maxclass = (int)$max; if (!isset($CURUSER)) return false; if (!valid_class($minclass) || !valid_class($maxclass)) return false; if ($maxclass < $minclass) return false; return (bool)($CURUSER['class'] >= $minclass && $CURUSER['class'] <= $maxclass); } function is_valid_user_class($class){ return is_numeric($class) && floor($class) == $class && $class >= UC_USER && $class <= UC_SYSOP; } Replace for user bars class Code:
$HTMLOUT .= "<tr><td class='rowhead'>{$lang['userdetails_class']}</td> <td class='col1' align='left'> <img src=" . get_user_class_image($user["class"]) . " " . get_user_class_name($user["class"]) . "</td></tr>\n"; $HTMLOUT .= "<tr> And thanks to bigjoos for the function get_user_class Just a side Note this will also work on u232 v1 v2 v3 v4 and v5 Last edited by Napon; 30th November 2018 at 00:33. |
The Following User Says Thank You to Napon For This Useful Post: | ||
elvira (29th November 2018)
|
#2
|
||||
|
||||
nice this is for TBDev 09 will post later for TBDev08
|
#3
|
|||
|
|||
Yes i do have a 08 too, Aswell to mysqli 08 PHP 5.6.32 with its own themes too no bittorrant crap ilke ive seen on here no names but we know who.... this ill not release out here sorry
Last edited by Napon; 29th November 2018 at 22:41. |
Tags |
anonymous , browse , colours , details |
|
|