Level Color Nick Chat

Started on the old forum in September 2008 · view the original in the archive · old links redirect here

7 replies · 928 views · started 18 years ago · 1 min read

sweetangel Lead · 885 posts #1

I have problem with this code at chat page:

if(ismod($uid)) { 
  $addClass = " Blued"; 
} 
else { 
  if(isowner(getuid_sid($sid))) 
    { 
      $addClass = " Greened"; 
    } 
  else { 
      if(isheadadmin(getuid_sid($sid))) { 
        $addClass = " Yellowed"; 
      } 
      else { 
         if(isadmin(getuid_sid($sid))) { 
           $addClass = " Redded"; 
         } 
         else { 
           $addClass = " Default"; 
         } 
      } 
   } 
} 
echo "[$ds]<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";

in css I have add:

.Blued{ color: #0000A0; background-color: #E0FFFF; } .Redded{ color: #C11B17; background-color: #F9966B; } .Yellowed{ color: #AF7817; background-color: #FFF380; } .Greened{ color: #254117; background-color: #6AFB92; } .Default{color: deepskyblue;}

but not work this code...

any1 can give me help 4 fix??? tnks..

if like my post click:

External image (may be gone)

Guest #2

this should work

<?
if(ismod($uid)){ 
  $addClass = "Blued"; 
} elseif(isowner(getuid_sid($sid))){ 
      $addClass = "Greened"; 
    } elseif(isheadadmin(getuid_sid($sid))){ 
        $addClass = "Yellowed"; 
      } elseif(isadmin(getuid_sid($sid))){ 
           $addClass = "Redded"; 
         } else { 
           $addClass = "Default"; 
    }
echo "[$ds]";
echo "<a href=\"chat.php?action=say2&sid=$sid&who=$chat[0]&rid=$rid&rpw=$rpw\">$optlink</a> - ";
?>
Guest #4

my code is part of page php..I have open ?php tag...:)

well 🙂 just remove the php tags and replace your code with mine 🙂

Guest #6

so it doesnt work? 😀 post the screenshot if you can, are functions ismod(), isowner(), isheadadmin(), isadmin() there and working? why you use getuid_sid($sid) and not just $uid? you use ismod($uid) and isowner(getuid_sid($sid) the functions have different arguments or? i cant see why is this not working lol 😛

as i can see getuid_sid($sid) gets $uid by $sid right? but by ismod($uid) i can see that $uid is already there 😛

sorry i dont use lavalair 😀

Guest #8

well, the best solution is to zip the script and post it, because i cant help you if i dont know where is the problem 🙂

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close