Bravo List
Register
Go Back   > Bravo List > Source Code > Archived Trackers > TBDev
Reply
  #1  
Old 14th April 2012, 14:46
HUnter83 HUnter83 is offline
Senior Member
 
Join Date: Aug 2010
United Kingdom
Posts: 46
Default class colour
I know i could do this and it colors it

Code:
case UC_ADMINISTRATOR: return "<font color=red>Administrator</font>";
but i have made a function like this

Code:
 function get_user_class_color($class)
{
  switch ($class)
  {
    case UC_USER: return "#000000";

    case UC_POWER_USER: return "#00FF00";

    case UC_VIP: return "#8E35EF";

    case UC_UPLOADER:  return "#FF00FF";

    case UC_MODERATOR: return "#0000FF";

    case UC_ADMINISTRATOR: return "#FF0000";

    case UC_SYSOP: return "#008000";
  }
  return "";
}
but when i code it like this

get_user_class_color($CURUSER["class"]) ." )" .

i get the class name and color code like this (administrator#FF0000)

any ideas ?
Reply With Quote
  #2  
Old 14th April 2012, 14:56
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
would need to see the complete line
Code:
get_user_class_color($CURUSER["class"]) ." )" .
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #3  
Old 14th April 2012, 15:23
HUnter83 HUnter83 is offline
Senior Member
 
Join Date: Aug 2010
United Kingdom
Posts: 46
Default
line on bittorrent php

Code:
"<div id='statusbar'>".
        "<b><div style='float:left;color:black;'>{$lang['gl_msg_welcome']}: </b><a href='userdetails.php?id={$CURUSER['id']}'>{$CURUSER['username']}</a> (&nbsp;" . get_user_class_name($CURUSER["class"]) ." )" .
and line on userdetails.php

Code:
    $HTMLOUT .= "<tr><td class='rowhead'>{$lang['userdetails_class']}</td><td align='left'>" . get_user_class_name($user["class"]) . "</td></tr>\n";
Reply With Quote
  #4  
Old 14th April 2012, 15:56
joeroberts's Avatar
joeroberts joeroberts is offline
BT.Manager Owner
 
Join Date: Jan 2008
United States
Posts: 2,113
Default
lol I wanted to see how you put your new code in to make it read
Quote:
(administrator#FF0000)
if your function is working like it should you would use
PHP Code:
"<div id='statusbar'>".
        
"<b><div style='float:left;color:black;'>{$lang['gl_msg_welcome']}: </b><a href='userdetails.php?id={$CURUSER['id']}'>{$CURUSER['username']}</a> (&nbsp;<font color='".get_user_class_color($CURUSER["class"])."'>" get_user_class_name($CURUSER["class"]) ."</font> )" 
PHP Code:
    $HTMLOUT .= "<tr><td class='rowhead'>{$lang['userdetails_class']}</td><td align='left'><font color='".get_user_class_color($CURUSER["class"])."'>" get_user_class_name($CURUSER["class"]) ."</font></td></tr>\n"
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent
Do not ask me to make a mod for any other source
Do not Ask me to setup your site.
I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum
My Current Demo is here http://demo.btmanager.org/
Reply With Quote
  #5  
Old 14th April 2012, 18:00
HUnter83 HUnter83 is offline
Senior Member
 
Join Date: Aug 2010
United Kingdom
Posts: 46
Default
works perfect thanks joe
Reply With Quote
  #6  
Old 18th April 2012, 16:05
kwek kwek is offline
Member
 
Join Date: Oct 2010
Netherlands
Posts: 3
Default class colour
in to vars.php

//USER_COLOR_CLASS BEGIN
$color_id_20 = "#ff0000"; // Misbruikers == UC_MISBRUIKER
$color_id_21 = "#000000"; // Users == UC_USER
$color_id_22 = "#FF1493"; // Top gebruikers == UC_POWER_USER
$color_id_23 = "#ffff00"; // V.I.P. Gebruikers == UC_VIP
$color_id_24 = "#ffffff"; // Partners == UC_PARTNERS
$color_id_25 = "#ffffff"; // Designers == UC_DESIGNER
$color_id_26 = "#00ff00"; // Uploader == UC_UPLOADER
$color_id_27 = "#cd5c5c"; // Super uploaders == UC_SUPERUPLOADER
$color_id_28 = "#CC00CC"; // Moderator == UC_MODERATOR
$color_id_29 = "#800080"; // Administrators == UC_ADMINISTRATOR
$color_id_30 = "#ffffff"; // Super Administrators == UC_SUPER_ADMINISTRATOR
$color_id_31 = "#cd5c5c"; // Beheerders == UC_SYSOP
$color_id_32 = "#CD5C5C"; // Oprichters == UC_OWNER
$color_id_33 = "#ffa500"; // Systeembeheerders == UC_GOD
$color_id_34 = "#660000"; // Webmasters == UC_WEB
$color_id_35 = "#0000ff"; // Scripters == UC_SCRIPTER
$color_id_36 = "#00ff7f"; // Master == UC_MASTER
//USER_COLOR_CLASS EINDE

| <font color=$color_id_20>Misbruiker</font>
| <font color=$color_id_21>Gebruiker</font>
| <font color=$color_id_22>Top Gebruiker</font>
| <font color=$color_id_23>Vip Gebruiker</font>
| <font color=$color_id_24>Dj</font>
| <font color=$color_id_25>Designers</font>
| <font color=$color_id_26>Uploader</font>
| <font color=$color_id_27>Super Uploader</font>
| <font color=$color_id_28>Moderator</font>
| <font color=$color_id_29>Administrator</font>
| <font color=$color_id_30>Super Administrator</font>
| <font color=$color_id_31>Beheerder</font>
| <font color=$color_id_32>Oprichter</font>
| <font color=$color_id_33>Systeem beheerder</font>
| <font color=$color_id_34>Webmaster</font>
| <font color=$color_id_35>Scripter</font></a>
| <font color=$color_id_36>Master</font></a>


change the id to your own ID code you used on your site

place it in site_funcion
require_once("include/vars.php");

have fun
Reply With Quote
Reply

Tags
class , colour

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT +2. The time now is 14:57. vBulletin skin by ForumMonkeys. Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.