Размер файла: 2.55Kb
<?
// TxtWAP v.1.2//
// by mr.Magister//
// for Либерти Crew//
// wap: http://Lwap.Ru//
//e-mail: [email protected]//
// icq: 878477 //
include("../../header.php"); //говорим, что это вап-документ
include("../../function_translit.php"); //подключаем транслит
$shop = file("../../shop.TXT");
include("../../config.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 != "config.php" and $file != "index.php" and $file != "chitalka.php" and $file != "header.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;//так надо (ред. Маг)
?>
<html>
<card id="card1" title="<? echo "Стр. $pageof из $total_pages " ?>">
<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))
{
$file_name_tr = tsdecode($file_name);//юзаем транслит (прим. Мага)
echo "<a href=\"$file_name\">$file_name_tr</a><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\">След.</a> ";
}
if (($file_count > 0) AND ($page != 0))
{
// предыдущая страница
$prev_page = $page -1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Пред.</a>";
}
echo "<br/>Всего: <b>$file_count</b><br/>";
}
closedir($dp);
?>
= <a href="../">в раздел</a><br/>
= <a href="/index.php">На главную</a><br/>
</small>
<? echo $banners; //вставляем баннеры и др. из конфига ?>
</p>
<? include("../../footer.php"); ?>