chromed Posted May 11, 2008 Posted May 11, 2008 Does anybody know how to change the color of a users name without going to edit user then typing in their name box <font color=FFFFFF>Chromed</font> ect. This would be ok but when you click on this persons name to mail them it comes up with that code instead of just the coloured name. Any help would be appreciated. Quote
-Matt- Posted May 11, 2008 Posted May 11, 2008 Re: Name Colour Change if ($r['user_level']==1) { $color=white; } ect if ($r['userid']==1) { $color=white; } or... Quote
Isomerizer Posted May 11, 2008 Posted May 11, 2008 Re: Name Colour Change killah just basically said.. But here it is again.. $ID = 1; // User & 1 = blue, 2 = green, 3 = yellow, 4 = brown. if ($userid == $ID) { $color = array('1' => 'blue', '2' => 'green', '3' => 'yellow', '4' => 'brown'); echo '<font color="'.$color[$ID].'">'; } Add before username is displayed, then after </font> Quote
Haunted Dawg Posted May 11, 2008 Posted May 11, 2008 Re: Name Colour Change Like i had explained on msn... Here is an example for people that want to change there own color name. SQL: alter table users add name_color varchar(255) not null default 'black'; Preferences: (TOP) case 'name_color': font_color(); break; Bottom: function font_color() { global $ir,$h; if($_POST['font']) { $font = mysql_real_escape_string($_POST['font'])); $game_color = "Game Link Color's ETC EX: black"; if($font == $game_color) { echo 'The game color is '.$game_color.' and you may not use it.'; $h->endpage(); exit; } mysql_query("UPDATE users SET name_color='".$font."' WHERE userid=".$ir['userid']) or die(mysql_error()); echo 'Your name color has been changed to '.$font; $h->endpage(); exit; } echo ' <form action="?action=name_color" method="post"> Color: <input type="text" name="font" value="'.$ir['name_color'].'"> <input type="submit" value="Change"> </form>'; } Then of course the link: Change name color Now to display it. <font color='".$ir['name_color']."'>".$ir['userid']."</font> So for example i use a green: <font color='green'>killah</font> Quote
Magictallguy Posted May 11, 2008 Posted May 11, 2008 Re: Name Colour Change Hey hey nicely done! :D Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.