Файл: sys/fnc/user.php
Строк: 199
<?php
function user($user = NULL) {
global $set, $time;
$ank = mysql_fetch_array(mysql_query("SELECT `id`, `nick`, `browser`, `country`, `activity`, `online`, `sex`, `rating`, `money`, `ncolor`, `ncolor2`, `group_access`, `date_reg`, `date_last` FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['date_last'] > (TIME - 600)) {
if ($ank['sex'] == 1) {
echo "<img src = '/style/img/user1on.png' /> ";
} else {
echo "<img src = '/style/img/user0on.png' /> ";
}
} else {
if ($ank['sex'] == 1) {
echo "<img src = '/style/img/user1off.png' /> ";
} else {
echo "<img src = '/style/img/user0off.png' /> ";
}
}
if ($ank['id'] > 0) {
echo "<a href = '/info.php?id=$ank[id]'>";
echo text::gradient("$ank[nick]", "$ank[ncolor]", "$ank[ncolor2]");
echo "</a> ";
} elseif ($ank['id'] == 0) {
echo "Система ";
}
echo country($ank['id']);
if ($ank['date_last'] > (TIME - 600)) {
if ($ank['browser'] == 'web'){
echo " <small><font color = 'green'>Веб</font> <img src = '/style/img/web.png' title = 'Пользователь с компьютера'/></small>";
} else {
echo " <small><font color = 'green'>Моб</font> <img src = '/style/img/web.png' title = 'Пользователь с телефона'/></small>";
}
} else {
if ($ank['browser'] == 'web'){
echo " <small><font color = 'grey'>Веб</font> <img src = '/style/img/web_off.png' title = 'Пользователь с компьютера'/></small>";
} else {
echo " <small><font color = 'grey'>Моб</font> <img src = '/style/img/mob.png' title = 'Пользователь с телефона'/></small>";
}
}
}
function medals($user = 0) {
$ank = mysql_fetch_array(mysql_query("SELECT `nick`, `country`, `browser`, `activity`, `sex`, `rating`, `ncolor`, `ncolor2`, `group_access`, `date_reg`, `date_last` FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['activity'] >= 300 && $ank['activity'] <= 599) {
echo "<img src = '/style/img/medals/bronze_1.png' alt = '' /> ";
}
if ($ank['activity'] >= 600 && $ank['activity'] <= 899) {
echo " <img src = '/style/img/medals/bronze_2.png' alt = '' /> ";
}
if ($ank['activity'] >= 900 && $ank['activity'] <= 1199) {
echo " <img src = '/style/img/medals/bronze_3.png' alt = '' /> ";
}
if ($ank['activity'] >= 1200 && $ank['activity'] <= 1499) {
echo " <img src = '/style/img/medals/silver_1.png' alt = '' /> ";
}
if ($ank['activity'] >= 1500 && $ank['activity'] <= 1799) {
echo " <img src = '/style/img/medals/silver_2.png' alt = '' /> ";
}
if ($ank['activity'] >= 1800 && $ank['activity'] <= 2099) {
echo " <img src = '/style/img/medals/silver_3.png' alt = '' /> ";
}
if ($ank['activity'] >= 2100 && $ank['activity'] <= 2399) {
echo " <img src = '/style/img/medals/gold_1.png' alt = '' /> ";
}
if ($ank['activity'] >= 2400 && $ank['activity'] <= 2799) {
echo " <img src = '/style/img/medals/gold_2.png' alt = '' /> ";
}
if ($ank['activity'] >= 2700 && $ank['activity'] <= 3000) {
echo " <img src = '/style/img/medals/gold_3.png' alt = '' /> ";
}
if ($ank['activity'] >= 3001 && $ank['activity'] <= 999999999999) {
echo "<img src = '/style/img/medals/vip.png' alt = '' /> ";
}
}
function country($user = 0) {
$ank = mysql_fetch_array(mysql_query("SELECT `nick`, `country`, `browser`, `activity`, `sex`, `rating`, `ncolor`, `ncolor2`, `group_access`, `date_reg`, `date_last` FROM `user` WHERE `id` = $user LIMIT 1"));
if ($ank['country'] == "Россия" || $ank['country'] == "россия" || $ank['country'] == "russia" || $ank['country'] == "Russia") {
echo "<img src = '/style/img/country/russia.png' title = 'Живет в России'/> ";
} elseif ($ank['country'] == "Украина" || $ank['country'] == "украина" || $ank['country'] == "ukraine" || $ank['country'] == "Ukraine") {
echo "<img src = '/style/img/country/ukraine.png' title = 'Живет в Украине'/> ";
} elseif ($ank['country'] == "США" || $ank['country'] == "сша" || $ank['country'] == "USA" || $ank['country'] == "usa") {
echo "<img src = '/style/img/country/usa.png' title = 'Живет в Соединенных Штатах Америки'/> ";
} elseif ($ank['country'] == "Испания" || $ank['country'] == "испания" || $ank['country'] == "Spain" || $ank['country'] == "spain") {
echo "<img src = '/style/img/country/spain.png' title = 'Живет в Испании'/> ";
} elseif ($ank['country'] == "Армения" || $ank['country'] == "армения" || $ank['country'] == "armenia" || $ank['country'] == "Armenia") {
echo "<img src = '/style/img/country/armenia.png' title = 'Живет в Армении' /> ";
} elseif ($ank['country'] == "Германия" || $ank['country'] == "германия" || $ank['country'] == "germany" || $ank['country'] == "Germany") {
echo "<img src = '/style/img/country/germany.png' title = 'Живет в Германии' /> ";
} elseif ($ank['country'] == "Румыния" || $ank['country'] == "румыния" || $ank['country'] == "romania" || $ank['country'] == "Romania") {
echo "<img src = '/style/img/country/romania.png' title = 'Живет в Румынии' /> ";
} elseif ($ank['country'] == "Узбекистан" || $ank['country'] == "узбекистан" || $ank['country'] == "uzbekistan" || $ank['country'] == "Uzbekistan") {
echo "<img src = '/style/img/country/uzbekistan.png' title = 'Живет в Узбекистане' /> ";
}
}