include "conf.php";
$ff = strip_tags(trim($_GET['f']));
$forNext = strip_tags(trim($_GET['f']));
$d = strip_tags(trim($_GET['d']));
$ff .= ".jpg";
$foto_file = $d."/".$ff;
if(!file_exists($foto_file)) $foto_file = "foto/".$d."/".$ff;
$readme_file = $d."/readme.txt";
if(!file_exists($readme_file)) $readme_file = "foto/".$d."/readme.txt";
$fotocomment_file = $d."/fotocomment.txt";
if(!file_exists($fotocomment_file)) $fotocomment_file = "foto/".$d."/fotocomment.txt";
// если запросили несуществующий документ.
if(file_exists($foto_file) == FALSE)
{
header("HTTP/1.1 404 Not Found");
?>
- Страница не найдена
Запрашиваемая страница не найдена. Скорее всего страница была перемещена.
exit;
}
// error 404, если указано >= 3 параметров
$param = explode("&", getenv('QUERY_STRING'));
if(count($param) >= 4)
{
?>
404 - Страница не найдена
Запрашиваемая страница не найдена.
// формируем заголовок страницы
if(file_exists($readme_file))
{
$fi = @file($readme_file); // открываем файл с описанием радела
$str = "Пауэрлифтинг в Константиновске. ".$fi[0].". Фото ".substr($ff, 0, strlen($ff)-4);
$str_p = $fi[0]." — Фото ".substr($ff, 0, strlen($ff)-4);
}
else
$str = " - ";
//теперь, если есть файл с комментариями к фоткам, будем приписывать вначале заголовка эти комментарии
if(file_exists($fotocomment_file))
{
$fotocomment_array = file($fotocomment_file); //считываем файл с комментариями к фоткам
$fotocomment = trim($fotocomment_array[substr($ff, 0, strlen($ff)-4) - 1]);
if($fotocomment != "")
{ $str = $fotocomment." ".$fi[0].". Фото ".substr($ff, 0, strlen($ff)-4);
$str_p = $fotocomment." ".$fi[0].". Фото ".substr($ff, 0, strlen($ff)-4);
}
}
echo "".$str."";
?>
include "includes/header.php";
?>
include "includes/topmenu.php";
?>
include "includes/leftmenu.php";
?>
include "includes/opros.php";
include "includes/rss.php";
?>
 |
if( $fotocomment != "" ) echo $fotocomment;
else echo $str_p;
?>
|
 |
$backurl = "foto.php";
$backurl_param = "";
if($_GET['backurl'] != "")
{
$backurl = trim(strip_tags($_GET['backurl']));
$backurl_param = "&backurl=".urlencode($backurl);
}
$temp = $forNext-1; if(file_exists("foto/".$d."/".$temp.".jpg") != false) echo "Назад | ";?>
Содержание
$temp = $forNext+1; if(file_exists("foto/".$d."/".$temp.".jpg") != false) echo " | Далее";?>
|
|
|
include "includes/footer.php";
?>