Файл: sys/core/nick.php
Строк: 84
<?php
function nick($us = null, $type = 'link', $img = 1, $ban_text = null) {
global $set;
$ank = get_user($us);
if ($ank['mylink'] == null) {
$ank['mylink'] = 'id' . $ank['id'];
}
if ($type == 'link') {
$link = '<a href="/' . $ank['mylink'] . '">';
$link_end = '</a>';
} else {
$link = null;
$link_end = null;
}
if ($img == 1) {
$browser = user_browser($us);
$icons = user_icon($us);
$medal = user_medal($us);
} else {
$browser = null;
$icons = null;
$medal = null;
}
#если забанен
$ban_user = mysql_result(query("SELECT COUNT(*) FROM `ban` WHERE `id_user` = '$us' AND `time` > '" . time() . "'"), 0) != 0;
#Рега от
$usreg = $ank['date_reg'] > time() - $set['user_reg_time'];
$nicks = output_text($ank['nick']);
if ($ban_text == null) {
$ban_text = '<span style="text-decoration:line-through;">';
$ban_text_end = '</span>';
} else {
$ban_text = null;
$ban_text_end = null;
}
if (!$ban_user) {
$nick_r = ($ank != null ? $nicks : $set['nick_system']);
} else {
$nick_r = $ban_text . ' ' . ($ank != null ? $nicks : $set['nick_system']) . ' ' . $ban_text_end;
}
if ($type != null) {
$new = ($usreg ? $ank['pol'] == 0 ? ' <span class="label label-success"> NEW </span> ' : ' <span class="label label-success"> NEW </span> ' : false);
} else {
$new = null;
}
$nick = $nick_r;
return ($link . $medal . $icons . $nick . $browser . $new . $link_end);
}