<?
// ////// // // // //
// // // // ///// /////
///// \\ // // // // // // // // // // // //
// // \\ // // // // // // // // // ////// // //
// // \\ // // // // // // // // // // // //
///// \// ////// // // // // // ///// // //
// /////
//
/////////////////////////// [email protected] ///////////////////////////////
Error_Reporting(E_ALL & ~E_NOTICE);
header("Content-type:text/vnd.wap.wml;charset=UTF-8");
include "config.php";
list($msec,$sec)=explode(chr(32),microtime());
$HeadTime=$sec+$msec;
print "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE wml PUBLIC \"-//WAPFORUM//DTD WML 1.1//EN\" \"http://www.wapforum.org/DTD/wml_1.1.xml\">
<wml>
<card id=\"tes\" title=\"Kapтинки\">
<p align=\"center\">";
$tf=0;
$trans2= array("Ё","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы","ъ","Ъ");
$trans1= array("РЃ","Р–","Р§","РЁ","Р©","Р","Р®","РЇ","С‘","Р¶","С‡","С€","С‰","СЌ","СЋ","СЏ","Рђ","Р‘","Р’","Р“","Р”","Р•","Р—","Р?","Р™","Рљ","Р›","Рњ","Рќ","Рћ","Рџ","Р ","РЎ","Рў","РЈ","Р¤","РҐ","Р¦","Р¬","Р«","Р°","Р±","РІ","Рі","Рґ","Рµ","Р·","Рё","Р№","Рє","Р»","Рј","РЅ","Рѕ","Рї","СЂ","СЃ","С‚","Сѓ","С„","С…","С†","СЊ","С‹","СЉ","РЄ");
$trans3= array("A","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы","ъ","Ъ");
print "
<small>$welcome_text</small></p><p>";
$substr_count = substr_count($kat,"../");
if($substr_count>0){$kat="";}
$nad="./";
$dir = opendir ("$nad$kat");
while ( $file = readdir ($dir))
{
if (( $file != ".") && ($file != "..")&& ($file != "dir.gif"))
{
$ras=strrchr($file, "$nad$kat");
if($ras!=".zap" & $ras!=".php"){
$name=@file("$nad$kat$file.zap");
$name=trim($name[0]);
if($name==""){$name=$file;}
$name=str_replace($trans1,$trans2,$name);
$name=str_replace($trans2,$trans3,$name);
$ar[$tf]=$name;
$far[$tf]=$file;
$tf=$tf+1;
}
}
}
closedir ($dir);
$popravka=$tf%15;
$popravka=$tf-$popravka;
$stranic=$popravka/15;
$stranic=$stranic+1;
$cl=0;
asort($ar);
foreach($ar as $key => $val) {
$popravka=$cl%15;
$popravka=$cl-$popravka;
$str=$popravka/15;
$str=$str+1;
if($pst=="" || $pst>$stranic || $pst<1){$pst=1;}
if($str==$pst){
$file=$far[$key];
$name=$ar[$key];
if(filesize("$nad$kat$file")){$size=filesize("$nad$kat$file");} else {$size="dir";}
if ($size < 1024) $size = $size."";
if ($size >= 1024) $size = round (($size/1024), 0)." Kb";
if ($size >= 1024) $size = round (($size/1024), 1)." Mb";
$si="<small> <b>[$size]</b> </small>";
if($size=="dir"){print"
<img src=\"../i/p.gif\" alt=\"\"/>
<anchor title=\"go\">$name
<go href=\"index.php?kat=$kat$file/\">
</go></anchor>
<br/>
";}
else{ print"<img src=\"pic.php?file=$kat$file\"/>»
<anchor title=\"go\">$name
<go href=\"preview.php?file=$nad$kat$file&fs=$size&back=$kat/\">
</go></anchor>
<br/><br/>
";}}
$cl=$cl+1;
}
$next=$pst+1;
$time=time();
print"<br/>Страница $pst из $stranic<br/>";
if($stranic>1){print"Перейти на страницу:
<input name=\"pst$time\" maxlength=\"8\" value=\"$next\" format=\"*N\"/>
<anchor title=\"ok\">перейти
<go href=\"index.php\" method=\"post\">
<postfield name=\"pst\" value=\"$(pst$time)\"/>
<postfield name=\"kat\" value=\"$kat\"/>
</go>
</anchor><br/><br/>";}
if($kat!=""){print"<a href=\"../index.php\">К разделам</a><br/>";}
print"</p><p align=\"center\">
<a href=\"../\">Haзaд</a><br/><small>$copyright<br/><b>";
list($msec,$sec)=explode(chr(32),microtime());
echo "".round(($sec+$msec)-$HeadTime,4)." ceкyнд <br/>";
print "</b>
</small>
</p>
<p>
</p>
</card>
</wml>";
?>