<?
if((@$src)and(@$nw)and(@$nh))// если заданы все характеристики по ссылке
{
$dl=strlen($src);
$list=substr($src,$dl-3,3);
if($list=="jpg")// если jpg графика
{
$tip=100; // сжатие JPG
$imold=imageCreateFromJPEG($src);
$size=getImageSize($src);
$ow=$size[0];
$oh=$size[1];
$image=imageCreate($nw,$nh);
ImageCopyresized($image,$imold,0,0,0,0,$nw,$nh,$ow,$oh);
header("Content-type: image/jpg");
imagejpeg($image,"",$tip);
}
if($list=="gif")// если gif графика
{
$imold=imageCreateFromGIF($src);
$size=getImageSize($src);
$ow=$size[0];
$oh=$size[1];
$image=imageCreate($nw,$nh);
ImageCopyresized($image,$imold,0,0,0,0,$nw,$nh,$ow,$oh);
header("Content-type: image/gif");
imagegif($image);
}
if($list=="png")// если png графика
{
$imold=imageCreateFromPNG($src);
$size=getImageSize($src);
$ow=$size[0];
$oh=$size[1];
$image=imageCreate($nw,$nh);
ImageCopyresized($image,$imold,0,0,0,0,$nw,$nh,$ow,$oh);
header("Content-type: image/png");
imagePNG($image);
}
}
include("../../header.php");
$shop = file("../../shop.TXT");
include("../../config.php");
include("../../function_translit.php");//добавляем файл с транслитом (прим. Мага)
if (!isset($page)) {$page = 0;}
$total = 0;
if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php")
{
$file_array[] = $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
$total_pages = ceil($file_count/$conf["items_per_page"]);//cкока всего страниц с округлением (ред. Маг)
$pageof = $page + 1;//так надо (ред. Маг)
?>
<onevent type="onenterforward"><refresh><setvar name="p" value=""/></refresh></onevent>
<p mode="nowrap">
<small>
<?
echo "$magazin";
if ($file_count > 0)
{
$first_record = $page * $conf["items_per_page"];
$last_record = $first_record + $conf["items_per_page"];
while (list($fileIndexValue, $file_name) = each ($file_array))
{
if (($fileIndexValue >= $first_record) AND ($fileIndexValue < $last_record))
{
$translit_file = tsdecode($file_name);//делаем транслит (прим. Мага)
echo "<img src=\"index.php?src=$file_name&nw=33&nh=33\"/><br/><a href=\"$file_name\">$translit_file</a> (". round(filesize($file_name)/1024,1) . "kb)<br/>";
$total = $total + filesize($file_name);//а размер?
}
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// След.
$next_page = $page + 1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page&translit=$translit\">След.</a> ";
}
if (($file_count > 0) AND ($page != 0))
{
// Пред.
$prev_page = $page -1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page&translit=$translit\">Пред.</a>";
}
echo "<br/>Всего: <b>$file_count</b><br/>";
}
closedir($dp);
?>
= <a href="../?translit=1">в раздел</a><br/>
= <a href="/index.php">На главную</a><br/>
</small>
<? echo $banners; //вставляем баннеры и др. из конфига ?>
</p>
<? include("../../footer.php"); ?>