Вход Регистрация
Файл: avatars/index.php
Строк: 112
<?php

require_once '../incfiles/core.php';
require_once 
'../incfiles/func.php';
require_once 
'../incfiles/auth.php';
require_once 
'../incfiles/user.php';

if (!empty(
$_GET['id']) && is_numeric($_GET['id']))
{
    
$id abs(intval($_GET['id']));
    
$result mysql_query("SELECT * FROM `users` WHERE `id` = '".$id."' LIMIT 1");
    if (
mysql_num_rows($result) == true$arr_user mysql_fetch_array($result);
        else 
go(URL);
}
else 
go(URL);


$title $arr_user['name'].' '.$arr_user['surname'].' :: Аватарки';
require_once 
'../incfiles/head.php';
require_once 
'handler/upload.php';
require_once 
'handler/del_avatar.php';

echo 
user_access_page($arr_user);

    echo 
'<div class="title">
    <a href="'
.URL.'/?id='.$id.'" onclick="Page.Go(this.href); return false">'.$arr_user['name'].' '.$arr_user['surname'].'</a>
    <a href="'
.URL.'/photos/?id='.$id.'" onclick="Page.Go(this.href); return false">'.lang('Фотоальбомы','Фотоальбоми').'</a>';
    
        
    if (!empty(
$user_id) && $device == 'Computer') echo' <a class="title_a_hover" href="'.URL.'/avatars/?id='.$id.'" onclick="Title.Open(); return false">Аватарки <img src="'.URL.'/design/img/title_menu.png"/></a>
    </div>'
;
    if (!empty(
$user_id) && $user_id == $arr_user['id'])
    {
        
//if ($user['count_avatars']==0) echo '<p><div class="time"><center>'.lang('Для загрузки аватарки нажмите на кнопку<p>Загрузить аватарку <img src="'.URL.'/design/img/title_menu.png"/></a>','Для завантаження аватарки натисніть на кнопку<p><a class="title_a_hover" href="'.URL.'/avatars/?id='.$id.'" onclick="Title.Open(); return false">Аватарки <img src="'.URL.'/design/img/title_menu.png"/></a></p> яка містить в собі приховане меню').'</center></div></p>';

        
if (!empty($user_id) && $device == 'Mobile') echo '<div id="title">
        <div class="block">
        <div class="for_pc">
        <button class="button" id="upload">'
.lang('Загрузить','Завантажити').' аватарку</button>
        </div>
        <div class="for_mobile">
        '
.lang('Загрузить','Завантажити').' аватарку:<br/>
        <form action="'
.URL.'/avatars/?id='.$user_id.'" method="post" enctype="multipart/form-data">
        <input class="input2" name="file" type="file"/> 
        <input class="button2" type="submit" name="upl" value="'
.lang('Загрузить','Завантажити').'" />
        </form>
        </div>
        </div></div>'
;
    }
    
    if (!empty(
$user_id) && $user_id == $arr_user['id'])
    {
        echo 
'<div id="title_menu">
        <div class="block">
        <div class="for_pc">
        <button class="button" id="upload">'
.lang('Загрузить','Завантажити').' аватарку</button>
        </div>
        <div class="for_mobile">
        '
.lang('Загрузить','Завантажити').' аватарку:<br/>
        <form action="'
.URL.'/avatars/?id='.$user_id.'" method="post" enctype="multipart/form-data">
        <input class="input2" name="file" type="file"/> 
        <input class="button2" type="submit" name="upl" value="'
.lang('Загрузить','Завантажити').'" />
        </form>
        </div>
        </div></div>'
;
        if (!empty(
$user_id) && $device == 'Computer') if ($user['count_avatars']==0) echo '<p><div class="time"><center>'.lang('Для загрузки аватарки нажмите на кнопку<p><a class="title_a_hover" href="'.URL.'/avatars/?id='.$id.'" onclick="Title.Open(); return false">Аватарки <img src="'.URL.'/design/img/title_menu.png"/></a></p>которая содержит в себе скрытое меню','Для завантаження аватарки натисніть на кнопку<p><a class="title_a_hover" href="'.URL.'/avatars/?id='.$id.'" onclick="Title.Open(); return false">Аватарки <img src="'.URL.'/design/img/title_menu.png"/></a></p> яка містить в собі приховане меню').'</center></div></p>';
    }    

    
$all mysql_result(mysql_query("SELECT COUNT(`id`) FROM `avatars` WHERE `user_id` = '".$arr_user['id']."' LIMIT 1"),0);
    if (
$all == true)
    {
        echo 
'<div class="block"><center><span id="upload_avatar"></span>';

        
$cp ceil($all/12);
        
$p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>and $_GET['p']<=$cp) ? $_GET['p'] : 1;
        
$start $p*12-12;
        
$n $start;
        
$res mysql_query("SELECT * FROM `avatars` WHERE `user_id` = '".$arr_user['id']."' ORDER by `time` DESC LIMIT $start,12");
        while (
$arr mysql_fetch_array($res))
        {
            
$n++;
            echo 
'<a href="'.URL.'/avatars/preview.php?id='.$id.'&n='.$n.'" onclick="Page.Go(this.href); return false;"><img class="preview_mini" src="'.URL.'/files/avatars/'.$arr_user['id'].'/mini/'.$arr['name'].'"></a>';
        }
        echo
'</center></div>';

        
navi($p,$cp,'/avatars/?id='.$arr_user['id'].'&');
    }

require_once 
'../incfiles/foot.php';

?>
Онлайн: 0
Реклама