function nick user_id Если пользователь существует if mysql_result mys

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?
function nick($user_id)
{
# Если пользователь существует
if (mysql_result(mysql_query("SELECT COUNT(*) FROM `users` WHERE `id` = '". num($user_id) ."' LIMIT 1"), 0) == 1)
{
$nick_user = mysql_fetch_array(mysql_query("SELECT * FROM `users` WHERE `id` = '". num($user_id) ."' LIMIT 1"));
if ($nick_user['level'] == 3) $dolj = '<b> <span class="dolj"><span style="color:green;font-size:10px">Мд</span></span></b>';
else if ($nick_user['kidala'] == 1) $dolj = ' <span class="dolj"><span style="color:green;font-size:10px"><font color="red"><b>Мошенник</b></font></span></span>';
else if ($nick_user['level'] == 4) $dolj = '<b> <span class="dolj"><span style="color:green;font-size:10px">Ст.мд</span></span></b>';
else if ($nick_user['level'] == 5) $dolj = '<b> <span class="dolj"><span style="color:green;font-size:10px">Адм</span></span></b>';
else if ($nick_user['level'] == 6) $dolj = '<b> <span class="dolj"><span style="color:green;font-size:10px">Ст.адм</span></span></b>';
else if ($nick_user['level'] == 7) $dolj = '<b> <span class="dolj"><span style="color:green;font-size:10px">Соз</span></span></b>';
if ($nick_user['xstatus'] == 0)$dolj = '';
else if ($nick_user['xstatus'] == 1)$dolj = ' <img src="'.$HOME.'/images/x-status/1.png" alt="*" />';
else if ($nick_user['xstatus'] == 2)$dolj = ' <img src="'.$HOME.'/images/x-status/2.png" alt="*" />';
else if ($nick_user['xstatus'] == 3)$dolj = ' <img src="'.$HOME.'/images/x-status/3.png" alt="*" />';
else if ($nick_user['xstatus'] == 4)$dolj = ' <img src="'.$HOME.'/images/x-status/4.png" alt="*" />';
else if ($nick_user['xstatus'] == 5)$dolj = ' <img src="'.$HOME.'/images/x-status/5.png" alt="*" />';
else if ($nick_user['xstatus'] == 6)$dolj = ' <img src="'.$HOME.'/images/x-status/6.png" alt="*" />';
else if ($nick_user['xstatus'] == 7)$dolj = ' <img src="'.$HOME.'/images/x-status/7.png" alt="*" />';
else if ($nick_user['xstatus'] == 8)$dolj = ' <img src="'.$HOME.'/images/x-status/8.png" alt="*" />';
else if ($nick_user['xstatus'] == 9)$dolj = ' <img src="'.$HOME.'/images/x-status/9.png" alt="*" />';
else if ($nick_user['xstatus'] == 10)$dolj = ' <img src="'.$HOME.'/images/x-status/10.png" alt="*" />';
else if ($nick_user['xstatus'] == 11)$dolj = ' <img src="'.$HOME.'/images/x-status/11.png" alt="*" />';
else if ($nick_user['xstatus'] == 12)$dolj = ' <img src="'.$HOME.'/images/x-status/12.png" alt="*" />';
else if ($nick_user['xstatus'] == 13)$dolj = ' <img src="'.$HOME.'/images/x-status/13.png" alt="*" />';
else if ($nick_user['xstatus'] == 14)$dolj = ' <img src="'.$HOME.'/images/x-status/14.png" alt="*" />';
else if ($nick_user['xstatus'] == 15)$dolj = ' <img src="'.$HOME.'/images/x-status/15.png" alt="*" />';
else if ($nick_user['xstatus'] == 16)$dolj = ' <img src="'.$HOME.'/images/x-status/16.png" alt="*" />';
else if ($nick_user['xstatus'] == 17)$dolj = ' <img src="'.$HOME.'/images/x-status/17.png" alt="*" />';
if ($nick_user['color'] != NULL) $nick = str2gradient($nick_user['login'], $nick_user['color'], $nick_user['color1'], $nick_user['xstatus']) . $dolj;
else if ($nick_user['color'] == NULL) $dolj = $nick_user['xstatus'] .$nick = $nick_user['login']. $dolj;
}
else
{
$nick = '[Удален]';
}
return $nick;
}
?>