GregFest Posted February 27, 2011 Posted February 27, 2011 how can you change user levels colors on v2, having a little trouble Quote
sniko Posted February 27, 2011 Posted February 27, 2011 Research into IF() statements. For example if($ir['user_level'] == 2) //Admin { $username = "<font color='#FF0000'>{$ir['username']}</font>"; //Red Username if Admin } echo "[b]{$username}[/b]"; -sniko Quote
Spudinski Posted February 27, 2011 Posted February 27, 2011 I don't want to sound like a total douche, but; using logical statements aren't the way to go on this. I would suggest something like: function _ucolr($user=null) { if ($user == null) $userlevel= $r['user_level']; else { { ... fetch user_level with the name ... } } return '<span class="user_color_' . $userlevel . '">' . $username . '</span>'; }' Quote
GregFest Posted February 27, 2011 Author Posted February 27, 2011 where would i place this code? Quote
Kieran-R Posted February 27, 2011 Posted February 27, 2011 Just make a simple function for it, and everytime the username would get displayed, use the function on that. If you don't know how to make a function for it, them you should probally look at a few tutorials for it. Nothing to hard tbh Quote
MrEvilChaos Posted March 3, 2011 Posted March 3, 2011 I'm having the sam problem but I want there User Level to show a color like if I was an Owner my user level would be Gold and admin Red so User Level: Owner and the Owner would be gold Sorry if I didnt explain right 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.