Bravo List

Bravo List (http://www.bvlist.com/index.php)
-   TBDev (http://www.bvlist.com/forumdisplay.php?f=20)
-   -   class colour (http://www.bvlist.com/showthread.php?t=7830)

HUnter83 14th April 2012 14:46

class colour
 
I know i could do this and it colors it

Code:

case UC_ADMINISTRATOR: return "Administrator";
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 ?

joeroberts 14th April 2012 14:56

would need to see the complete line
Code:

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

\n";
HUnter83 14th April 2012 15:23

line on bittorrent php

Code:

"
".
        "
{$lang['gl_msg_welcome']}: {$CURUSER['username']} ( " . get_user_class_name($CURUSER["class"]) ." )" .
and line on userdetails.php

Code:

    $HTMLOUT .= "
{$lang['userdetails_class']}" . get_user_class_name($user["class"]) . "

joeroberts 14th April 2012 15:56

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"


HUnter83 14th April 2012 18:00

works perfect thanks joe

kwek 18th April 2012 16:05

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

| Misbruiker
| Gebruiker
| Top Gebruiker
| Vip Gebruiker
| Dj
| Designers
| Uploader
| Super Uploader
| Moderator
| Administrator
| Super Administrator
| Beheerder
| Oprichter
| Systeem beheerder
| Webmaster
| Scripter
| Master


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


All times are GMT +2. The time now is 14:05.

Powered by vBulletin® Version 3.8.11 Beta 3
Copyright ©2000 - 2024, vBulletin Solutions Inc.