Вход Регистрация
Файл: public_html/element_online_user.php
Строк: 167
<?php
require_once './element_options/element_options.php';
require_once 
'./element_function/element_function_standart.php';
    
if (!
$user) { header('Location: /'); exit; }
    if (
readcache('element_user_mesto'.$user['lost_id']) != 'Кто онлайн'writecache('element_user_mesto'.$user['lost_id'], 'Кто онлайн');
    
        if (
$go == 'search') {
        
$to = (isset($_GET['to']) AND !empty($_GET['to'])) ? addslashes(htmlspecialchars($_GET['to'])) : false;
        
$title 'Поиск персонажа';
        require_once 
'./element_include/element_head.php';
        require_once 
'./element_include/element_header_user_true.php';
        echo 
'<div class="nfl p5 mb5 mt5 mlra">';
        echo 
'<div class="mb5 cntr small"><a class="button w50" href="/online">Кто онлайн</a></div>';
        
            if (
$to == 'go') {
            
$nick = (isset($_POST['nick']) AND !empty($_POST['nick'])) ? addslashes(htmlspecialchars(trim($_POST['nick']))) : false;
                if (
$nick) {
                    
$query mysql_query("SELECT * FROM `element_user` WHERE `lost_login` LIKE '%$nick%' LIMIT 10");
                    
$num_query mysql_num_rows($query);
                }
            }
        
        echo 
'<div class="cntr p5 mt5 mb5 mlra">
        <form method="post" action="/online?go=search&to=go">
        <input class="fdark w98 mb10" type="text" name="nick" value="'
.((isset($nick) AND !empty($nick)) ? $nick '').'" size="20" maxlength="255">
            <span class="mt5 btn w30">
                <span class="el"><span class="er">
                    <input class="ttl" type="submit" id="" name="submit" value="Искать">
                </span></span> 
            </span> 
        </form></div>'
;
        
            if (
$to == 'go' AND isset($num_query)) {
                if (
$num_query 0) {
                echo 
'<div class="nf2 small p5 yellow1 mt5 mlra">';
                
$color 1;
                while (
$myrrow mysql_fetch_array($query)) {
                    
$_st mysql_result(mysql_query("SELECT COUNT(*) FROM `users_online` WHERE `user`='{$myrrow['lost_id']}' LIMIT 1"), 0);
                if (
$color 2$odd ' odd'; else $odd '';
            
                echo 
'
                <div class="ml5 mr5">
                <a class="bl p5 small block'
.$odd.'" href="/user?id='.$myrrow['lost_id'].'">
                <span class="white small fr">'
.$mesto.'</span>
                '
.ikonka_user($myrrow['lost_race'], ($_st 'online' 'offline')).' <span class="yellow1">'.$myrrow['lost_login'].'</span>    
                </a>
                </div>
                '
;
                
$color++;
                }
                echo 
'</div>';
                } else echo 
'<div class="nf2 small p5 cntr red mt5 mlra">Персонаж "'.$nick.'" не найден</div>';
            
            }
        
        
        echo 
'</div>';
        require_once 
'./element_include/element_foot_user_true.php';
        exit;
        }
    
    
$online_c = (int) mysql_result(mysql_query("SELECT COUNT(*) FROM `users_online` WHERE `expr`>'".(time() - 3600)."'"), 0);
    
$title 'Кто онлайн: '.$online_c;
    require_once 
'./element_include/element_head.php';
    require_once 
'./element_include/element_header_user_true.php';
    echo 
'<div class="nfl p5 mb5 mt5 mlra">';
    echo 
'<div class="mb5 cntr small"><a class="button w50" href="/online?go=search">Поиск по нику</a></div>';
            if (
$online_c)
            {
                require_once 
'./element_function/element_function_pagination.php';
                
$page = (isset($_GET['page']) AND is_numeric($_GET['page'])) ? (int)$_GET['page'] : 1;
                
$pagination pagination(10$page$online_c);
                
$color $pagination['start'];
                echo 
'<div class="mt5 mlra">';
                
$i $pagination['start'] + 1;
                
$online_ mysql_query("SELECT * FROM `users_online` WHERE `expr`>'".(time() - 3600)."' LIMIT {$pagination['start']}{$pagination['num']}");
            while (
$item mysql_fetch_assoc($online_))
            {
                
$online_user cache_user($item['user']);
                if (
$color 2$odd ''; else $odd ' odd';
                
$mesto readcache('element_user_mesto'.$item['user']);
                
$mesto = (!empty($mesto)) ? $mesto 'Играет';
            
                    
//$req = mysql_query("SELECT `expr` FROM `users_online` WHERE `user` ='{$myrrow['lost_id']}'");
                //$on = mysql_fetch_array($req);
                //$time = time();
                //$time_o = ($item['expr'] + 6000);
                //if($time_o < $time) { $status = '*'; }
               
                
echo '
                <div class="ml5 mr5">
                    <a class="bl p5 small block'
.$odd.'" href="/user?id='.$item['user'].'">
                    <span class="white small fr">'
.$mesto.'</span>
                        '
.$i.'. '.ikonka_user($online_user['lost_race'], 'online').' <span class="yellow1">'.$online_user['lost_login'].' '.$status.', '.$online_user['lost_level'].' ур.</span>    
                    </a>
                </div>
                '
;
            
            
$color++;
            
$i++;
            }
                echo 
'</div>';
            }
            
    echo 
'</div>';
    echo 
pagination_echo($pagination['page'],$pagination['total'],'/online?page=');
    require_once 
'./element_include/element_foot_user_true.php';
?>
Онлайн: 1
Реклама