<?php
error_reporting(0);
//----------
session_name('sid');
session_start();
//----------
include ('inc/config.inc.php.php');
connect_to_db();
include ('inc/autorize.php.php');
//----------
if (!$autorize) {
header('Location: index.php?partner='.$partner.'&'.$srand.'='.$r_rand);
exit();
}
//----------
$id = mysql_escape_string(htmlspecialchars(intval($id)));
$fd = mysql_escape_string(htmlspecialchars($fd));
//----------
if ($autorize['id'] !== $id) {
header('Location: index.php?partner='.$partner.'&mod='.$mod.'&'.$srand.'='.$r_rand.'&'.session_name().'='.session_id());
exit();
}
//----------
$partner = intval($_GET['partner']); if ($partner == 0) $partner = 1;
//----------
$arr = mysql_query("SELECT COUNT(*) FROM `love_partner`;");
$part_users = mysql_result($arr, 0);
if($partner > $part_users) $partner = 1;
//----------
$partner_arr = @mysql_query("SELECT * FROM `love_partner` WHERE `partner` = ".$partner." LIMIT 1;");
$row = @mysql_fetch_array($partner_arr);
$partner_site = $row['site'];
$partner_name = $row['name'];
//----------
$files = glob("./foto/".$id."/".$fd);
//----------
$result = @mysql_query("SELECT * FROM `love_user` WHERE `nick` = '".$nick."';");
$arr = @mysql_fetch_array($result);
$photo = $arr['foto'];
$fotos = $photo - 1;
//-----------
$title = 'Фотоальбом';
include ('header.php');
echo $header;
if($mod == '1') echo '<p align="center"><small>';
echo $class_d2;
echo'Фотоальбом <b>'.$nick.'</b><br/>';
echo $class_divz;
if($mod == '1') echo '</small></p><p align="left"><small>';
if ($files) {
echo $class_d0;
echo 'Фотография <b>'.$fd.'</b> удалена!<br/>';
echo $class_divz.$class_d0;
if($mod == '1') echo '---<br/>';
echo '-&#187; <a href="upload.php?partner='.$partner.'&amp;mod='.$mod.'&amp;'.$srand.'='.$r_rand.'&amp;'.session_name().'='.session_id().'">Фотоальбом</a><br/>';
if($mod == '1') echo '---<br/>';
echo $class_divz;
@unlink($files[0]);
@mysql_query("UPDATE `love_user` SET `foto` = '".$fotos."' WHERE `nick` = '".$nick."'");
}
else
{
echo $class_d0;
echo 'Такой фотографии не существует или она удалена!<br/>';
echo $class_divz.$class_d0;
if($mod == '1') echo '---<br/>';
echo '-&#187; <a href="upload.php?partner='.$partner.'&amp;mod='.$mod.'&amp;'.$srand.'='.$r_rand.'&amp;'.session_name().'='.session_id().'">Фотоальбом</a><br/>';
if($mod == '1') echo '---<br/>';
echo $class_divz;
}
echo $class_d1;
echo '[7] <a href="http://'.$_SERVER['HTTP_HOST'].'/index.php?partner='.$partner.'&amp;mod='.$mod.'&amp;'.session_name().'='.session_id().'" accesskey="7">Поиск</a> [8] <a href="http://'.$_SERVER['HTTP_HOST'].'/menu.php?partner='.$partner.'&amp;mod='.$mod.'&amp;'.session_name().'='.session_id().'" accesskey="8">Личное меню</a> [9] <a href="http://'.$_SERVER['HTTP_HOST'].'/out.php?partner='.$partner.'&amp;mod='.$mod.'&amp;'.session_name().'='.session_id().'" accesskey="9">Выход</a><br/>';
if($mod == '1') echo '</small></p><p align="center"><small>';
echo $class_divz.$class_d2;
echo $class_divz.$class_d2.$class_version.$class_divz.$class_div;
echo $class_endpage;
?>