Файл: photos/index.php
Строк: 87
<?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);
if (!empty($_GET['target']) && !empty($_GET['from']) && is_numeric($_GET['from'])) $target = '&target='.check($_GET['target']).'&from='.abs(intval($_GET['from'])); else $target = '';
$title = $arr_user['name'].' '.$arr_user['surname'].' :: '.lang('Фотографии','Фотографії');
require_once '../incfiles/head.php';
require_once 'handler/new_album.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 class="title_a_hover" href="'.URL.'/photos/?id='.$id.'" onclick="Title.Open(); return false">'.lang('Фотоальбомы','Фотоальбоми').' <img src="'.URL.'/design/img/title_menu.png"/></a>
    </div>';
    if (!empty($user_id) && $user_id == $arr_user['id'])
    {
        echo '<div id="title_menu"><div class="block2">
        '.lang('Название фотоальбома','Назва фотоальбому').':<br/>
        <form id="form" action="'.URL.'/photos/?id='.$id.'" method="post">
        <input class="input2" style="width:70%;" type="text" name="name"/>
        <input class="button2" type="submit" value="'.lang('Создать','Створити').'"/>
        </form>
        </div></div>';
    }    
    if (!empty($user_id) && $user_id == $id && $_GET['target'] != 'group_wall') echo '<div class="block"><a href="'.URL.'/photos/wall_photos.php'.(!empty($target)?'?album=wall_photos'.$target:'').'" onclick="Page.Go(this.href); return false;"><b>'.lang('Вложения','Вкладення').'</b></a> <b>'.$user['count_wall_photos'].'</b></div>';
    if ($target == false) echo '<div class="block"><a href="'.URL.'/avatars/?id='.$arr_user['id'].'" onclick="Page.Go(this.href); return false;"><img class="album_cover" src="'.URL.''.(!empty($arr_user['avatar'])?'/files/avatars/'.$arr_user['id'].'/icons/'.$arr_user['avatar']:'/design/img/album_cover.png" style="border:0;').'"/><ul><b>Аватарки</b></a> <b>'.$arr_user['count_avatars'].'</b><br/><br/><br/></ul></div>';
$all = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `photos_albums` WHERE `user_id` = '".$arr_user['id']."' LIMIT 1"),0);
    if ($all == true)
    {
        $cp = ceil($all/10);
        $p = (isset($_GET['p']) and is_numeric($_GET['p']) and $_GET['p']>1 and $_GET['p']<=$cp) ? $_GET['p'] : 1;
        $start = $p*10-10;
        $res = mysql_query("SELECT * FROM `photos_albums` WHERE `user_id` = '".$arr_user['id']."' ORDER by `uptime` DESC LIMIT $start,10");
        while ($arr = mysql_fetch_array($res))
        {
            echo '<div class="block">
            <a href="'.URL.'/photos/album.php?id='.$arr['id'].''.$target.'" onclick="Page.Go(this.href); return false;"><img class="album_cover" src="'.URL.''.(!empty($arr['cover'])?'/files/photos/'.$arr['user_id'].'/icons/'.$arr['cover']:'/design/img/album_cover.png" style="border:0;').'"/><b>'.$arr['name'].'</b></a> <b>'.$arr['count_photos'].'</b>
            <ul>
            '.lang('Обновлен','Оновлений').': '.vtime($arr['uptime']).'<br/>
            '.lang('Создан','Створений').': '.vtime($arr['time']).'
            </ul>
            </div>';
        }
        navi($p,$cp,'/photos/?id='.$arr_user['id'].'&');
    }
    else if (!empty($user_id) && $user_id == $arr_user['id'] && $all == 0) echo '<p><div class="time"><center>'.lang('Для создания фотоальбома нажмите на кнопку<p><a class="title_a_hover" href="'.URL.'/photos/?id='.$id.'" onclick="Title.Open(); return false">'.lang('Фотоальбомы','Фотоальбоми').' <img src="'.URL.'/design/img/title_menu.png"/></a></p>которая содержит в себе скрытое меню','Для створення фотоальбому натисніть на кнопку<p><a class="title_a_hover" href="'.URL.'/photos/?id='.$id.'" onclick="Title.Open(); return false">'.lang('Фотоальбомы','Фотоальбоми').' <img src="'.URL.'/design/img/title_menu.png"/></a></p> яка містить в собі приховане меню').'</center></div></p>';
    
require_once '../incfiles/foot.php';
?>