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
colored nick online and in chat.php
Collapse
X
-
i ve tryed thi but don t work
PHP Code://////////////////////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];
}
-
PHP Code: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>';
}
Last edited by i0nutzxp; 02.06.11, 03:57.<?php unlink('World/Europe/Romania.country'); ?>
Comment
-
@i0nutzxp after </div> ' (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.
ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ â“â“¡â“” â“ⓑⓛⓔ ⓣⓞ â“—â“”â“â“¡ !
ιη тнєσÑу, тнє ÏÑα¢тι¢є ιѕ α Ñєѕυℓт σƒ тнє тнєσÑу, вυт ιη ÏÑα¢тι¢є ιѕ тнє σÏÏσѕιтє.
Comment
-
Originally posted by i0nutzxp View PostPHP Code: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>';
}
Comment
Comment