Просмотр файла gallery/album.php

Размер файла: 2.1Kb
<?php

require '../inc/func.php';
bk_head('Album');
require '../inc/head.php';
if(!$user) {
	header('location: /index.php');
}

$album['id'] = num($_GET['num']);
$u['id'] = num($_GET['iau']);
$id = $u['id'];
$qqq = mysql_query("SELECT `id` FROM `users` WHERE `id` = '$id'");
if(!mysql_num_rows($qqq)){
	err (''.$lng_up['user'].'');
}
$qqqq = mysql_query("SELECT * FROM `album` WHERE `id` = '$album[id]' && `user` = '$id'");
if(!mysql_num_rows($qqqq)){
	err (''.$lng_up['al3'].'');
}

if (!$id) {
	$id = $userid;
}
echo '<div class="list1">';
if($id != $userid) {
	echo '<div class="tt">'.$lng_up['al'].' : ';
	user($id);
	echo '</div>';
} else {
	echo '<div class="tt">'.$lng_up['al2'].'</div>';
}


$count = mysql_result(mysql_query("SELECT COUNT(id) FROM `album_photo` WHERE `user` = '$u[id]' && `album` = '$album[id]'"),0);
if($count <= 0) {
	err (''.$lng_up['emptp'].'!');
}
#####page#####
$display = 4;
$count_pages = ceil($count/$display);
$page = (isset($_GET['page']) and is_numeric($_GET['page']) and $_GET['page']>1 and $_GET['page']<=$count_pages) ? $_GET['page'] : 1;
$start = $page*$display-$display;
#####end page########


$ph = mysql_query("SELECT * FROM `album_photo` WHERE `album` = '$album[id]' ORDER BY `time` DESC LIMIT $start, $display");
echo '<div class="left_bot"><div class="image"><p align="left">';
while($pre = mysql_fetch_assoc($ph)) {
	$fil = '/gallery/photos/'.$pre['user'].'/small/'.$pre['name'].'';
		echo '<a href="photo.php?num='.$pre['id'].'"><img src="'.$fil.'" width="100" height="100" /></a><br />';
}
echo '</div></p>';


if($count > 4 && $page < $count_pages)
{
echo '<div class="shadow">';
pages($page,$count_pages,"?num=$album[id]&iau=$id&page=");
echo '</div>';
}


echo '<br />';

echo '</div>';

if ($u['id'] == $userid) {
	echo '<a href="up.php?num=' . $album['id'] . '"><input type="button" value="&rarr; '.$lng_up['upload'].'" class="green" ></a>';
}
echo '<hr><div class="shadow"><a href="/users/my.php"><b>My Menu</b></a> | <a href="/u/'.$userid.'"><b>Profile</b></a> | <a href="/exit.php"><b>LogOut</b></a></div></div>';
bk_foot();