Файл: sys/fnc/vip.php
Строк: 10
<?
function vip($user){
global $set,$time;
$srok = 10;
if(mysql_result(mysql_query("SELECT COUNT(*) FROM `vipstat` WHERE `user` = '$user'"),0)==1){
$vip=mysql_fetch_array(mysql_query("SELECT * FROM `vipstat` WHERE `user`='$user' LIMIT 1"));
$return = '<img src="/vip_status/icon/'.$vip['icon'].'.png" alt="vip"/>';
}else{
$return = '';
}
//Удаляем тех кого вышло время
$q=mysql_query("SELECT * FROM `vipstat`");
while ($vips = mysql_fetch_array($q)){
if($vips['time']+86400*$srok<$time){mysql_query("DELETE FROM `vipstat` WHERE `id` = '$vips[id]'");}
}
return $return;
}
?>