Вход Регистрация
Файл: lider/main.php
Строк: 24
<?php
 defined
('_IN_JOHNCMS') or die('Error: restricted access');
$count_us db::result(db::query("select count(`id`) from `lider` where `time` >= '".time()."' and `user_id` = '".$user_id."'"),0);
echo 
'<a href="lider/"><div class="phdr">Лидеры дня</div></a>';
echo 
'<div class="menu">';
$count db::result(db::query("select count(*) from `lider` where `time` >= '".time()."'"),0);
if    (
$count    0) {
            
$sets1 explode('|'file_get_contents('lider/sets.dat'));
            
$req db::query("select * from `lider` where `time` >= '".time()."' order by rand() limit 1");
            
$res mysqli_fetch_array($req);
            
$us mysqli_fetch_array(db::query("SELECT `name`, `yearofbirth`, `dayb`, `monthb` FROM `users` WHERE `id` = '" $res['user_id'] . "' LIMIT 1"));
            echo 
'<table><tr>';
            if (
$sets1[1]) {
                    if (
file_exists('files/users/photo/' $res['user_id'] . '_small.jpg')) 
                        echo 
'<td><img src="../files/users/photo/' $res['user_id'] . '_small.jpg"  border="0" width="60"/></td>';
                    else 
                        echo 
'<td><img src="lider/no_photo.jpg" border="0" width="50"/></td>';
                }
            echo 
'<td><a href ="../users/profile.php?user='.$res['user_id'].'">' functions::checkout($us['name']). '</a>';
            if (
$sets1[2]) {
                        if (!
$us['yearofbirth'] or !$us['monthb'] or !$us['dayb']) 
                            
$a 0;
                        else {
                            
$r mktime(000$us['monthb'], $us['dayb'], $us['yearofbirth']);  
                            
$age = (time()-$r)/31536000
                            list(
$a) = explode(".",$age);   
                        }
                        echo 
', '.$a;
            }
            echo 
'<br /><i>' functions::checkout($res['text']) .'</i>' ;
            echo 
'</td></tr></table></div>';
}else{
                        echo 
'<div class="menu"><img src="lider/no_photo.jpg" border="1px" width="50"/></div>';
}
?>
Онлайн: 0
Реклама