Файл: photo.php
Строк: 222
<?
require_once("core/core.php");
require('core/ava_users.php');
if (!$u['id']) {
header("Location: reg.php?err=1");
exit;
}
$location = 'В аватарах';
switch ($_GET['act']) {
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Фото ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'add':
$ava = num($_POST['ava']);
$title = $title . ' :: Мой аватар';
include 'head.php';
require('core/page_ava.php');
echo '<div class="title"><center>Мой аватар</center></div>';
echo '<div class="title">';
echo '<a href = "photo.php"> К моим аватарам</a>';
echo '</div>';
//Если файл получен
if ($_FILES['ava']['tmp_name']) {
//Получаем информацию об изображении
$info = getimagesize($_FILES['ava']['tmp_name']);
//Создаем картинку в соответствии с ее типом
if ($info[0] > 100 && $info[1] > 100 || $info[0] <= 1024 && $info[1] <= 1280) {
if ($info['mime'] == 'image/jpeg') {
$create = imagecreatefromjpeg($_FILES['ava']['tmp_name']);
} else {
if ($info['mime'] == 'image/gif') {
$create = imagecreatefromgif($_FILES['ava']['tmp_name']);
} else {
if ($info['mime'] == 'image/png') {
$create = imagecreatefrompng($_FILES['ava']['tmp_name']);
} else {
echo '<div class="div"><font color="red"> Неподдерживаемый формат изображения!</font></div>';
$error = 1;
}
}
}
//Если формат поддерживается
if ($error != 1) {
$reg = mysql_query("select * from `users_photo` where `user`='" . $u['id'] . "' LIMIT 1");
if (mysql_num_rows($reg) != 0) {
mysql_query("UPDATE `users_photo` SET `page` = '0' WHERE `user` = '" . $u['id'] . "'");
}
mysql_query("INSERT INTO `users_photo` SET
`user` = '" . $u['id'] . "',
`time` = '" . time() . "',
`page` = '1'
");
$name = mysql_insert_id();
$id = mysql_insert_id();
mysql_query("UPDATE `users` SET `rating` = `rating`+10 WHERE `id` = '" . $u['id'] . "'");
if ($u['sex'] == 'm') {
$action[0] = 'Сменил';
} else {
$action[0] = 'Сменила';
}
$text = $action[0] . ' <a href = "photo.php?act=view&id=' . $id . '">аватар</a>.';
mysql_query("INSERT INTO `lenta` SET
`user` = '" . $u['id'] . "',
`text` = '$text',
`time` = '" . time() . "',
`new` = '1'
");
//Ищем папку пользователя, если нет создаем
$arhiv = intval(($u['id'] / 1000) + 1);
if (!is_dir('base/' . $arhiv . '/' . $u['id'] . '/photo') || !is_dir('base/' . $arhiv . '/' . $u['id'] . '/photo_small') || !is_dir('base/' . $arhiv . '/' . $u['id'] . '/photo_micro')) {
if (!is_dir('base/' . $arhiv . '')) {
@mkdir("base/" . $arhiv . "", 0777);
}
if (!is_dir('base/' . $arhiv . '/' . $u['id'] . '')) {
@mkdir("base/" . $arhiv . "/" . $u['id'] . "", 0777);
}
if (!is_dir('base/' . $arhiv . '/' . $u['id'] . '/photo')) {
@mkdir("base/" . $arhiv . "/" . $u['id'] . "/photo", 0777);
}
if (!is_dir('base/' . $arhiv . '/' . $u['id'] . '/photo_small')) {
@mkdir("base/" . $arhiv . "/" . $u['id'] . "/photo_small", 0777);
}
if (!is_dir('base/' . $arhiv . '/' . $u['id'] . '/photo_micro')) {
@mkdir("base/" . $arhiv . "/" . $u['id'] . "/photo_micro", 0777);
}
}
//Получаем уменьшенный размер (для большой авы)
$w = $info[0];
$h = $info[1];
if ($w > 500 || $h > 500) {
if ($w > $h) {
$o = $w / $h;
$ww = $w / 500;
$w = $w / $ww;
$hh = $h / (500 / $o);
$h = $h / $hh;
} else {
$o = $h / $w;
$hh = $h / 500;
$h = $h / $hh;
$ww = $w / (500 / $o);
$w = $w / $ww;
}
}
//Создаем изображение с рассчитанными размерами
$img = imagecreatetruecolor($w, $h);
//Уменьшаем исходное изображение
imagecopyresampled($img, $create, 0, 0, 0, 0, $w, $h, $info[0], $info[1]);
//Путь для сохранения
$dir = 'base/' . $arhiv . '/' . $u['id'] . '/photo/' . $name . '.jpg';
imagejpeg($img, $dir, 75);
//Получаем уменьшенный размер (для маленькой авы)
$w = $info[0];
$h = $info[1];
if ($w > 150 || $h > 150) {
if ($w > $h) {
$o = $w / $h;
$ww = $w / 150;
$w = $w / $ww;
$hh = $h / (150 / $o);
$h = $h / $hh;
} else {
$o = $h / $w;
$hh = $h / 150;
$h = $h / $hh;
$ww = $w / (150 / $o);
$w = $w / $ww;
}
}
//Создаем изображение с рассчитанными размерами
$img = imagecreatetruecolor($w, $h);
//Уменьшаем исходное изображение
imagecopyresampled($img, $create, 0, 0, 0, 0, $w, $h, $info[0], $info[1]);
//Путь для сохранения
$name = $name;
$dir = 'base/' . $arhiv . '/' . $u['id'] . '/photo_small/' . $name . '.jpg';
imagejpeg($img, $dir, 75);
//Получаем уменьшенный размер (для микро авы)
$w = $info[0];
$h = $info[1];
if ($w > 50 || $h > 50) {
if ($w > $h) {
$o = $w / $h;
$ww = $w / 50;
$w = $w / $ww;
$hh = $h / (50 / $o);
$h = $h / $hh;
} else {
$o = $h / $w;
$hh = $h / 50;
$h = $h / $hh;
$ww = $w / (50 / $o);
$w = $w / $ww;
}
}
//Создаем изображение с рассчитанными размерами
$img = imagecreatetruecolor($w, $h);
//Уменьшаем исходное изображение
imagecopyresampled($img, $create, 0, 0, 0, 0, $w, $h, $info[0], $info[1]);
//Путь для сохранения
$name = $name;
$dir = 'base/' . $arhiv . '/' . $u['id'] . '/photo_micro/' . $name . '.jpg';
imagejpeg($img, $dir, 75);
//Освобождаем память
imagedestroy($img);
header("Location: photo.php?act=view&id=$name");
}
} else {
echo '<div class = "error">Запрещенный размер фото!</div>';
}
}
echo '<div class="div">';
page_ava($u['id'], 75);
echo '</br>Фото (не более 1024x1280, не менее 100x100):';
echo '<br/><form action="photo.php?act=add" method="post" enctype="multipart/form-data">
<input type="file" name="ava">
<input type="submit" value="Загрузить"/></form>';
echo '</div>';
include 'foot.php';
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Просмотр фото ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'view':
if (isset($_GET['id'])) {
$id = num($_GET['id']);
$req = mysql_query("SELECT * FROM `users_photo` WHERE `id` = '$id' LIMIT 1");
if (mysql_num_rows($req)) {
$photo = mysql_fetch_assoc($req);
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $photo['user'] . "' LIMIT 1"));
}
}
if ($photo) {
$arhiv = intval(($user['id'] / 1000) + 1);
if ($u['id'] and $_POST['message']) {
$message = check(substr($_POST['message'], 0, 500));
$flood = mysql_query("SELECT `time` FROM `users_photo_comm` WHERE `user` = '" . $u['id'] . "' AND `time` > '" . (time() - 3) . "'");
if (mysql_num_rows($flood) > 0) {
header("Location: photo.php?act=view&id=" . $photo['id'] . "");
exit;
}
$req = mysql_query("SELECT * FROM `users_photo_comm` WHERE `user` = '" . $u['id'] . "' AND `photo` = '" . $photo['id'] . "' ORDER BY `time` DESC");
$res = mysql_fetch_array($req);
if ($res['message'] == $message) {
header("Location: photo.php?act=view&id=" . $photo['id'] . "");
exit;
}
mysql_query("INSERT INTO `users_photo_comm` SET
`user` = '" . $u['id'] . "',
`message` = '$message',
`time` = '" . time() . "',
`photo` = '" . $photo['id'] . "'
");
mysql_query("UPDATE `users` SET `rating` = `rating`+1 WHERE `id` = '" . $u['id'] . "'");
if ($u['sex'] == 'm') {
$action[0] = 'Прокомментировал';
} else {
$action[0] = 'Прокомментировала';
}
$text = $action[0] . '<a href = "photo.php?act=view&id=' . $id . '&show=comm"> аватарку</a>.';
mysql_query("INSERT INTO `lenta_foto` SET
`user` = '" . $u['id'] . "',
`text` = '$text',
`time` = '" . time() . "',
`new` = '1'
");
if ($u['sex'] == 'm') {
$action[0] = 'Прокомментировал';
} else {
$action[0] = 'Прокомментировала';
}
$text = $action[0] . '<a href = "photo.php?act=view&id=' . $id . '&show=comm"> аватарку</a>.';
mysql_query("INSERT INTO `lenta` SET
`user` = '" . $u['id'] . "',
`text` = '$text',
`time` = '" . time() . "',
`new` = '1'
");
header("Location: photo.php?act=view&id=" . $photo['id'] . "");
}
if ($user['id'] == $u['id']) {
$zag = 'Мой аватар';
} else {
$zag = 'Аватар со страницы <a href = "page.php?id=' . $user['id'] . '">' . $user['login'] . '</a>';
}
$title = $title . ' :: Аватар со страницы';
include 'head.php';
require('core/bb_code.php');
echo '<div class="title"><center>' . $zag . '</center></div>';
echo '<div class="nav">';
if ($user['id'] != $u['id'])
$all_photo = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users_photo` WHERE `user` = '".$user['id']."'"), 0);
echo '<a href = "photo.php?id=' . $user['id'] . '">Все аватары со страницы</a>';
echo '</div>';
echo '<div class="div">';
if ($_GET['mainpage'] && $photo['user'] == $u['id']) {
mysql_query("UPDATE `users_photo` SET `page` = '0' WHERE `user` = '" . $u['id'] . "'");
mysql_query("UPDATE `users_photo` SET `page` = '1' WHERE `user` = '" . $u['id'] . "' and `id` = '" . $photo['id'] . "'");
$photo['page'] = 1;
echo '<div class = "ok">Фотография установлена на страницу!</div><hr>';
}
if ($_GET['like'] && isset($u['id'])) {
$req = mysql_query("SELECT * FROM `users_photo_like` WHERE `user` = '" . $u['id'] . "' AND `photo` = '" . $photo['id'] . "' LIMIT 1");
if (!mysql_num_rows($req)) {
$photo['rating']++;
mysql_query("INSERT INTO `users_photo_like` SET
`user` = '" . $u['id'] . "',
`time` = '" . time() . "',
`photo` = '" . $photo['id'] . "'
");
mysql_query("UPDATE `users_photo` SET
`rating` = '" . $photo['rating'] . "'
WHERE `id` = '" . $photo['id'] . "'
");
if ($photo['user'] != $u['id']) {
if ($u['sex'] == 'm') {
$action[0] = 'Отметил';
$action[1] = 'ему';
} else {
$action[0] = 'Отметила';
$action[1] = 'ей';
}
$text = $action[0] . ' что ' . $action[1] . ' понравилась ваша <a href = "photo.php?act=view&id=' . $photo['id'] . '">фотография</a>.';
mysql_query("INSERT INTO `jurnal` SET
`user` = '" . $user['id'] . "',
`outuser` = '" . $u['id'] . "',
`text` = '$text',
`time` = '" . time() . "',
`new` = '1'
");
}
}
}
$count = mysql_result(mysql_query("SELECT COUNT(`id`) FROM `users_photo_comm` WHERE `photo` = '" . $photo['id'] . "'"), 0);
echo '<center><a href = "base/'.$arhiv.'/'.$user['id'].'/photo/'.$photo['id'].'.jpg"><img src = "base/'.$arhiv.'/'.$user['id'].'/photo_small/'.$photo['id'].'.jpg" width = "90" ></a><br/></center>';
echo '</div>';
echo '<div class=nav><center>';
echo '<script type="text/javascript" src="//yandex.st/share/share.js" charset="utf-8"></script><div class="yashare-auto-init" data-yashareL10n="ru" data-yashareType="none" data-yashareQuickServices="vkontakte,facebook,twitter,odnoklassniki,moimir,gplus"></div>';
echo '</div></center>';
if ($photo['user'] == $u['id']) {
echo '<div class="div">';
if ($photo['page'] == 1) {
echo '<img src="style/page/photos.gif"> Установлена на странице<br/>';
} else {
echo '<img src="style/page/add.gif"> <a href = "photo.php?act=view&id=' . $photo['id'] . '&mainpage=1">Установить на страницу</a> <br/>';
}
echo '<img src="style/page/add.gif"> <a href = "photo.php?act=add">Загрузить новую</a><br/>';
echo '<img src="style/page/delete.gif"> <a href = "photo.php?act=delete&id=' . $photo['id'] . '">Удалить</a></br>';
echo '</div>';
}
echo '<div class="nav">';
echo '<img src = "style/page/load.gif"> <a href = "base/' . $arhiv . '/' . $user['id'] . '/photo/' . $photo['id'] . '.jpg">Скачать</a></br>';
$req = mysql_query("SELECT * FROM `users_photo_like` WHERE `user` = '" . $u['id'] . "' AND `photo` = '" . $photo['id'] . "' LIMIT 1");
if (!mysql_num_rows($req)) {
echo '<img src = "style/page/like.png"> <a href = "photo.php?act=view&id=' . $photo['id'] . '&like=1">Мне нравится</a> (' . $photo['rating'] . ')';
} else {
echo '<img src = "style/page/like.png"> Понравилось: (' . $photo['rating'] . ')';
}
echo '</div>';
echo '<div class="title">';
echo ' Комментарии: (' . $count . ')';
echo '</div>';
echo '<div class="div">';
$o = abs(intval($_GET['o']));
$user = mysql_fetch_assoc(mysql_query("SELECT `login` FROM `users` WHERE `id` = '" . $o . "'"));
if ($user['login'])
$otv = $user['login'] . ', ';
echo '<form action="photo.php?act=view&id=' . $photo['id'] . '" method="post">';
echo '<textarea name="message">';
echo $otv;
echo '</textarea><br/>';
echo "<input type='submit' title='Нажмите для отправки' name='submit' value='Написать' class='submit white'/><small>
<a href = 'smiles.php'>Смайлы</a> | <a href = 'code.php'>Теги</a></small>
</form></div>";
if ($u['admin'] == 1 || $u['admin'] == 2 || $u['admin'] == 3 || $u['admin'] == 4 || $u['admin'] == 5 || $u['id'] == $photo['user']) {
if ($_GET['del']) {
$del = num($_GET['del']);
$commcheck = mysql_num_rows(mysql_query("SELECT * FROM `users_photo_comm` WHERE `id` = '$del' LIMIT 1"));
if ($commcheck) {
mysql_query("DELETE FROM `users_photo_comm` WHERE `id` = '$del'");
echo '<div class="div"><font color="green"> Комментарий удален!</font></div>';
}
}
}
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_photo_comm` WHERE `photo` = '" . $photo['id'] . "'"), 0);
if ($all > 0) {
$total = intval(($all - 1) / 10) + 1;
$page = num($_GET['page']);
if (empty($page) or $page < 0)
$page = 1;
if ($page > $total)
$page = $total;
$start = $page * 10 - 10;
if ($count >= 11)
echo '<div class="title">';
$sort = check($_GET['sort']);
if ($sort == 'message') {
$sortq = 'ASC';
if ($count >= 11)
echo '<a href = "photo.php?act=view&id=' . $photo['id'] . '&sort=time&page=' . $page . '">Новые</a> | <b>Поcледние</b>';
}
if ($sort == 'time' || empty($sortq)) {
$sort = 'time';
$sortq = 'DESC';
if ($count >= 11)
echo '<b>Новые</b> | <a href = "photo.php?act=view&id=' . $photo['id'] . '&sort=message&page=' . $page . '">Поcледние</a>';
}
if ($count >= 11)
echo '</div>';
$result = mysql_query("SELECT * FROM `users_photo_comm` WHERE `photo` = '" . $photo['id'] . "' ORDER BY `time` $sortq LIMIT $start, 10");
while ($comm = mysql_fetch_assoc($result)) {
$user = mysql_fetch_assoc(mysql_query("SELECT * FROM `users` WHERE `id` = '" . $comm["user"] . "'"));
$message = checkout($comm['message']);
echo '<div class="div">';
echo '<table><tr><td valign="top">';
ava($user['id'],45);
echo '</td><td VALIGN=top>';
if (ban($user['id'])) {
echo '' . ico($user['sex'], $user['admin'], $user['online']) . ' <a href = "page.php?id=' . $user['id'] . '"><del><b><font color="#79358c">' . $user['login'] . '</font></b></del></a>';
} else {
echo '' . ico($user['sex'], $user['admin'], $user['online']) . ' <a href = "page.php?id=' . $user['id'] . '"><b><font color="#79358c">' . $user['login'] . '</font></b></a>';
}
echo '' . medal($user['rating']) . '';
echo ' <small>' . vremya($comm['time']) . '</small>';
echo '<br/>';
echo '' . smile($message) . '';
echo '<br/>';
echo '<small>';
if ($user['id'] != $u['id'])
echo '[<a href = "photo.php?act=view&id=' . $photo['id'] . '&o=' . $user['id'] . '">ответить</a>] ';
if ($u['admin'] == 1 || $u['admin'] == 2 || $u['admin'] == 3 || $u['admin'] == 4 || $u['admin'] == 5) {
if (ban($user['id'])) {
if ($comm['user'] != $u['id'])
echo ' [<a href = "adminka.php?act=delban_users&id=' . $user['id'] . '"><font color="red">Разбанить</font></a>]';
} else {
if ($comm['user'] != $u['id'])
echo ' [<a href = "adminka.php?act=ban_users&id=' . $user['id'] . '"><font color="red">Бан</font></a>]';
}
}
if ($u['admin'] == 1 || $u['admin'] == 2 || $u['id'] == $photo['user']) {
echo ' [<a href = "photo.php?act=view&id=' . $photo['id'] . '&del=' . $comm['id'] . '">удалить</a>]';
}
echo '</small>';
echo '</table>';
echo '</div>';
}
echo '</div>';
navigation($page, $total, 'photo.php?act=view&id=' . $photo['id'] . '&sort=' . $sort . '&');
} else {
echo '<div class="div"> Комментариев еще нет !</div>';
}
include 'foot.php';
} else {
header("Location: photo.php");
}
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Удаление фото ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
case 'delete':
if ($u['id']) {
if (isset($_GET['id'])) {
$id = num($_GET['id']);
$req = mysql_query("SELECT * FROM `users_photo` WHERE `id` = '$id' AND `user` = '" . $u['id'] . "' LIMIT 1");
if (mysql_num_rows($req)) {
$photo = mysql_fetch_assoc($req);
}
}
if ($photo) {
$arhiv = intval(($u['id'] / 1000) + 1);
$title = $title . ' :: Мой аватар';
include 'head.php';
echo '<div class="title"><center>Мой аватар</center></div>';
echo '<div class="title">';
echo '<a href = "photo.php">К аватарам со страницы</a>';
echo '</div>';
echo '<div class="div">';
if (isset($_POST['submit'])) {
if ($photo['page'] == 1) {
$req = mysql_query("SELECT * FROM `users_photo` WHERE `user` = '" . $u['id'] . "' and `page` = '0' LIMIT 1");
if (mysql_num_rows($req) != 0) {
$req = mysql_query("SELECT * FROM `users_photo` WHERE `user` = '" . $u['id'] . "' and `page` = '0' ORDER BY `time` DESC");
$res = mysql_fetch_array($req);
mysql_query("UPDATE `users_photo` SET `page` = '1' WHERE `id` = '" . $res['id'] . "'");
}
}
unlink('base/' . $arhiv . '/' . $u['id'] . '/photo/' . $photo['id'] . '.jpg');
unlink('base/' . $arhiv . '/' . $u['id'] . '/photo_small/' . $photo['id'] . '.jpg');
unlink('base/' . $arhiv . '/' . $u['id'] . '/photo_micro/' . $photo['id'] . '.jpg');
mysql_query("DELETE FROM `users_photo` WHERE `id` = '" . $photo['id'] . "'");
mysql_query("DELETE FROM `users_photo_comm` WHERE `photo` = '" . $photo['id'] . "'");
mysql_query("DELETE FROM `users_photo_like` WHERE `photo` = '" . $photo['id'] . "'");
header('location: photo.php');
} else {
echo '<table>
<tr>
<td VALIGN=top>';
echo '<a href = "photo.php?act=view&id=' . $photo['id'] . '"><img src = "base/' . $arhiv . '/' . $u['id'] . '/photo_small/' . $photo['id'] . '.jpg" height = "50" ></a>';
echo '</td>
<td VALIGN=top>';
echo 'Вы уверены, что хотите удалить фото?<br/>';
echo '<form action="photo.php?act=delete&id=' . $id . '" method="post">';
echo '<input type="submit" name="submit" value="Да, удалить" class="submit white"/>';
echo '</form></div>';
echo '</td>
</tr>
</table>';
}
echo '</div>';
echo '<div class="title">';
echo '<img src="style/page/back.png" alt="Back"> <a href = "?sid=back" onclick="history.back()">Назад</a>';
echo '</div>';
include 'foot.php';
} else {
header("Location: photo.php");
}
} else {
header("Location: photo.php");
}
break;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~Список фотографий ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~//
default:
$id = num($_GET['id']);
if (!$id)
$id = $u['id'];
$req = mysql_query("SELECT * FROM `users` WHERE `id` = '$id' LIMIT 1");
if (mysql_num_rows($req)) {
$user = mysql_fetch_assoc($req);
}
if (!$user['id']) {
header("Location: index.php");
exit;
}
if ($id == $u['id'])
$zag = 'Мои аватары';
else
$zag = 'Аватары со страницы <a href = "/' . $user['id'] . '">' . $user['login'] . '</a>';
$title = $title . ' :: ' . $zag . '';
include 'head.php';
echo '<div class="title"><center>' . $zag . '</center></div>';
if ($id == $u['id']) {
echo '<div class="title"><img src="style/page/add.gif"> <a href = "photo.php?act=add">Загрузить новую</a></div>';
}
$all = mysql_result(mysql_query("SELECT COUNT(*) FROM `users_photo` WHERE `user` = '$id'"), 0);
if ($all > 0) {
$arhiv = intval(($user['id'] / 1000) + 1);
$total = intval(($all - 1) / 10) + 1;
$page = intval($_GET['page']);
if (empty($page) or $page < 0)
$page = 1;
if ($page > $total)
$page = $total;
$start = $page * 10 - 10;
$result = mysql_query("SELECT * FROM `users_photo` WHERE `user` = '$id' ORDER BY `time` DESC LIMIT $start, 10");
while ($photo = mysql_fetch_assoc($result)) {
echo '<div class="div">';
echo '<a href = "photo.php?act=view&id=' . $photo['id'] . '"><img src = "base/' . $arhiv . '/' . $user['id'] . '/photo_small/' . $photo['id'] . '.jpg" width = "100" ></a>';
echo '</div>';
}
echo '</div>';
navigation($page, $total, 'photo.php?id=' . $id . '&');
} else {
echo '<div class="div"> Фотографий еще нет !</div>';
}
echo '</div>';
if ($id == $u['id']) {
echo '<div class="title"><img src="style/page/add.gif"> <a href = "photo.php?act=add">Загрузить новую</a></div>';
}
include 'foot.php';
break;
}
?>