Файл: functions/nick.php
Строк: 35
<?php
/* Функции вывода ника юзера. */
function nick($var)
{
$result = mysql_query("SELECT * FROM users WHERE id = '".$var."' LIMIT 1");
$q = mysql_fetch_assoc($result);
if($q['login'])
{
if($q['gender'] == 1)
$gen = ' <img src="../images/man.png" alt="*" />';
else
if($q['gender'] == 2)
$gen = ' <img src="../images/woman.png" alt="*" />';
if($q['access'] == 2)
{
$access = ' <font color="green">[Мд]</font>';
}
else
if($q['access'] == 3)
{
$access = ' <font color="green">[Адм]</font>';
}
if(!empty($var))
{
$result = mysql_query("SELECT id FROM online WHERE us_id = '".$var."'");
if(mysql_num_rows($result))
{
$online = ' <img src="../images/online.gif" alt="*" />';
}
else
{
$online = ' <img src="../images/offline.gif" alt="*" />';
}
}
return $online.' <a href="/id'.$q['id'].'">'.$q['login'].'</a>'.$gen.$access;
}
else
{
return 'Удален';
}
}
?>