colored nick online and in chat.php

Started on the old forum in June 2011 · view the original in the archive · old links redirect here

5 replies · 710 views · started 15 years ago · 1 min read

3 participants
LadyEnigma Developer · 71 posts #1

Hello everyone I would like to make colored nick in my lavalair, for all users I would like to appear on the list is the colorful nickname online chat.php (for example pink nick for female and blu nick for male)i have already seen that in other posts around the forum but I've tried various codes that make me error 🙁 can anyone help? thanks in advance 🙂

....silence please....

LadyEnigma Developer · 71 posts #2

i ve tryed thi but don t work

//////////////////////GET USER NICK FROM USERID

{
  $unick = mysql_fetch_array(mysql_query("SELECT name,plusses,perm FROM ibwf_users WHERE id='".$uid."'"));
  
  if($unick[2]=='3')
  {
    return "<font color=\"red\">$unick[0]</font>";
  }
    else if($unick[2]=='2')
  {
    return "<font color=\"#999900\">$unick[0]</font>";
  }
   else if($unick[2]=='1')
  {
    return "<font color=\"#336600\">$unick[0]</font>";
  }
  
  else if($unick[3]>0)
  {
    return "<font color=\"#006666\">$unick[0]</font>";
  }
  
  return $unick[0];

  $unick = mysql_fetch_array(mysql_query("SELECT name,plusses, perm FROM ibwf_users WHERE id='".$uid."'"));
  return $unick[0];
}

anyone can help me?

....silence please....

i0nutzxp Developer · 150 posts #3
function getnick_uid($uid)
{
  $uid = (int) $uid;
   $query = mysql_query("SELECT sex, name, perm FROM ibwf_users WHERE id='$uid'");
   $info = mysql_fetch_assoc($query);
   if ($info['sex'] == 'F')
   {
      if ($info['perm'] == 1)
      {
         $color = 'pink';
      } //else else
       
   }
   else
  {
     if ($info['perm'] == 1)
     {
        $color = 'blue';
     }
    // else else ... 
  }

   return '<div style="color:'.$color.'">'.$info['name'].'</div>';

}

something like that????

<?php unlink('World/Europe/Romania.country'); ?>
metulj Super moderator Principal · 1,726 posts #4

i0nutzxp after ' (quotation mark) is missing ;)** **

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

LadyEnigma Developer · 71 posts #5

i0nutzxp wrote:

function getnick_uid($uid)
{
  $uid = (int) $uid;
   $query = mysql_query("SELECT sex, name, perm FROM ibwf_users WHERE id='$uid'");
   $info = mysql_fetch_assoc($query);
   if ($info['sex'] == 'F')
   {
      if ($info['perm'] == 1)
      {
         $color = 'pink';
      } //else else
       
   }
   else
  {
     if ($info['perm'] == 1)
     {
        $color = 'blue';
     }
    // else else ... 
  }

   return '<div style="color:'.$color.'">'.$info['name'].'</div>';

}

something like that????

i0nutzxp yes 🙂 but give me error:Fatal error: Cannot redeclare getnick_uid() (previously declared in /membri/ladyenigma/dream/web/core.php:3875) in /membri/ladyenigma/dream/web/core.php on line 3904 🙁

....silence please....

i0nutzxp Developer · 150 posts #6

And "Fatal error: Cannot redeclare getnick_uid()" dont means that a function with that name "getnick_uid" already exists??? Just delete the old function....

<?php unlink('World/Europe/Romania.country'); ?>

Write your reply now; next you create a free account (or sign in) and it is posted right away. 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