File size: 2.19Kb
<?
header("Cache-Control: no-cache");
header("Content-type:text/vnd.wap.wml; charset=utf-8");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
echo "<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\""." \"http://www.wapforum.org/DTD/wml_1.1.xml\">";
include("../wapbuddy_settings.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);
?>
<wml>
<card id="card1" title="wap.tegos.ru">
<p mode="nowrap">
<do type="option" label="Home"><go href="http://tegos.ru/home.wml"/></do>
<? echo "<a href=\"http://tegos.ru/home.wml\"></a><br/><br/>"; ?>
<?
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))
{
echo "<a href=\"$file_name\">$file_name</a> (". round(filesize($file_name)/1024,1) . "kb)<br/>";
$total = $total + filesize($file_name);
}
}
if (($file_count > 0) AND ($page != 0))
{
// previous button
$prev_page = $page -1;
echo "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">Back-Назад</a><br/>";
}
if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "<br/><a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">*>>>>*</a><br/>";
}
echo "<br/>http://tegos.ru<br/>$file_count ";
if ($file_count == 1)
{echo "file";}
else
{echo "files";}
echo " (" . round($total/1024,1) . "kb)";
echo "<br/><a href=\"http://tegos.ru/home.wml\">Главная-Home</a>";
echo "<br/><a href=\"http://tegos.ru/zagruzki/zagruzki.wml\">В загрузки</a>";
echo "<br/><a href=\"http://tegos.ru/dr/mmska.wml\">В платное</a>";
}
closedir($dp);
?>
</p>
</card>
</wml>