View file fotogallery/img/index.php

File size: 5.74Kb
<?

                    //                                      //////             //                                                //                        //           //
                    //                                      //       //                          //            /////                     /////                 
                    /////    \\        //          //        //         //       //    //        //     //      //     //               //           //
                    //   //     \\     //           //          //       //    //         //      //      //     //      //////     //           // 
                    //   //       \\ //             //        //         //      //    //         //      //     //               //     //           //
                    /////         \//               //////            //         //               //      //     //     /////        //           //  
                                         //                                                                                                                                    /////
                                        //

                  ///////////////////////////      [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&#x0442;&#x0438;&#x043D;&#x043A;&#x0438;\"> 
<p align=\"center\">";
$tf=0;
$trans2= array("Ё","Ж","Ч","Ш","Щ","Э","Ю","Я","ё","ж","ч","ш","щ","э","ю","я","А","Б","В","Г","Д","Е","З","И","Й","К","Л","М","Н","О","П","Р","С","Т","У","Ф","Х","Ц","Ь","Ы","а","б","в","г","д","е","з","и","й","к","л","м","н","о","п","р","с","т","у","ф","х","ц","ь","ы","ъ","Ъ");
$trans1= array("РЃ","Р–","Р§","РЁ","Р©","Р­","Р®","РЇ","С‘","Р¶","С‡","С€","С‰","СЌ","СЋ","СЏ","Рђ","Р‘","Р’","Р“","Р”","Р•","Р—","Р?","Р™","Рљ","Р›","Рњ","Рќ","Рћ","Рџ","Р ","РЎ","Рў","РЈ","Р¤","РҐ","Р¦","Р¬","Р«","Р°","Р±","РІ","Рі","Рґ","Рµ","Р·","Рё","Р№","Рє","Р»","Рј","РЅ","Рѕ","Рї","СЂ","СЃ","С‚","Сѓ","С„","С…","С†","СЊ","С‹","СЉ","РЄ");
$trans3= array("&#x041;","&#x0416;","&#x0427;","&#x0428;","&#x0429;","&#x042D;","&#x042E;","&#x042F;","&#x0451;","&#x0436;","&#x0447;","&#x0448;","&#x0449;","&#x044D;","&#x044E;","&#x044F;","&#x0410;","&#x0411;","&#x0412;","&#x0413;","&#x0414;","&#x0415;","&#x0417;","&#x0418;","&#x0419;","&#x041A;","&#x041B;","&#x041C;","&#x041D;","&#x041E;","&#x041F;","&#x0420;","&#x0421;","&#x0422;","&#x0423;","&#x0424;","&#x0425;","&#x0426;","&#x042C;","&#x042B;","&#x0430;","&#x0431;","&#x0432;","&#x0433;","&#x0434;","&#x0435;","&#x0437;","&#x0438;","&#x0439;","&#x043A;","&#x043B;","&#x043C;","&#x043D;","&#x043E;","&#x043F;","&#x0440;","&#x0441;","&#x0442;","&#x0443;","&#x0444;","&#x0445;","&#x0446;","&#x044C;","&#x044B;","&#x044A;","&#x042A;");
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\"/>&#187; 




<anchor title=\"go\">$name
<go href=\"preview.php?file=$nad$kat$file&amp;fs=$size&amp;back=$kat/\">
</go></anchor>
<br/><br/>
";}}


$cl=$cl+1;

}

$next=$pst+1;
$time=time();

print"<br/>&#x0421;&#x0442;&#x0440;&#x0430;&#x043D;&#x0438;&#x0446;&#x0430; $pst &#x0438;&#x0437; $stranic<br/>";
if($stranic>1){print"&#x041F;&#x0435;&#x0440;&#x0435;&#x0439;&#x0442;&#x0438; &#x043D;&#x0430; &#x0441;&#x0442;&#x0440;&#x0430;&#x043D;&#x0438;&#x0446;&#x0443;: 

<input name=\"pst$time\" maxlength=\"8\" value=\"$next\" format=\"*N\"/>
<anchor title=\"ok\">&#x043F;&#x0435;&#x0440;&#x0435;&#x0439;&#x0442;&#x0438;
<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\">&#x041A; &#x0440;&#x0430;&#x0437;&#x0434;&#x0435;&#x043B;&#x0430;&#x043C;</a><br/>";}



print"</p><p align=\"center\">
<a href=\"../\">Ha&#x0437;a&#x0434;</a><br/><small>$copyright<br/><b>";

list($msec,$sec)=explode(chr(32),microtime()); 
echo "".round(($sec+$msec)-$HeadTime,4)." ce&#x043A;y&#x043D;&#x0434; <br/>";
print "</b>
</small>
</p>
<p>
</p>
</card>
</wml>";

?>