Jump to content
MakeWebGames

Recommended Posts

Posted

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

Posted

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>';
}'
Posted

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

Posted

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...