View file wapp_antifront.com/downloads/ringtone/index.php

File size: 4.97Kb
<?php
Error_Reporting(E_ALL & ~E_NOTICE);

header("Cache-Control: no-cache");
header("Content-type:text/vnd.wap.wml; charset=utf-8");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>

<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.3//EN" "http://www.wapforum.org/DTD/wml13.dtd">
<wml>
<head><meta http-equiv="Cache-Control" content="no-cache" forua="true"/></head>
<card id="loads" title="&#x0420;&#x0438;&#x043D;&#x0433;&#x0442;&#x043E;&#x043D;&#x044B;">
<p>

<?

function trans($s)
{
$search  = array ("'A'","'B'","'V'","'G'","'D'","'E'","'J'","'Z'","'I'","'Y'","'K'","'L'","'M'","'N'","'O'","'P'","'R'","'S'","'T'","'U'","'F'","'H'","'C'","'&#1062;&#1093;'","'W'","'&#1057;&#1093;'","'&#1057;&#1062;&#1061;'","'Q'","'X'","'QQ'","'&#1049;e'","'&#1049;&#1091;'","'&#1049;a'","'a'","'b'","'v'","'g'","'d'","'e'","'j'","'z'","'i'","'y'","'k'","'l'","'m'","'n'","'o'","'p'","'r'","'s'","'t'","'u'","'f'","'h'","'c'","'&#1094;&#1093;'","'w'","'&#1089;&#1093;'","'&#1089;&#1094;&#1093;'","'q'","'x'","'q'","'&#1081;e'","'&#1081;&#1091;'","'&#1081;a'","'.&#1090;&#1099;&#1090;'","'.&#1076;a&#1090;'","'_'","'.&#1075;&#1080;&#1092;'","'.&#1078;&#1087;&#1075;'","'.&#1087;&#1085;&#1075;'","'.&#1084;&#1080;&#1076;'","'.&#1084;&#1084;&#1092;'","'.&#1096;a&#1074;'","'.a&#1084;&#1088;'","'M&#1080;&#1076;&#1080;'","'M&#1084;&#1092;'","'M&#1087;3'","'&#1064;a&#1074;'");
$replace = array ("A","&#1041;","&#1042;","&#1043;","&#1044;","E","&#1046;","3","&#1048;","&#1049;","K","&#1051;","M","&#1053;","O","&#1055;","&#1056;","&#1057;","T","&#1059;","&#1060;","&#1061;","&#1062;","&#1063;","&#1064;","&#1064;","&#1065;","&#1100;","&#1067;","&#1100;","&#1069;","&#1070;","&#1071;","a","&#1073;","&#1074;","&#1075;","&#1076;","e","&#1078;","&#1079;","&#1080;","&#1081;","&#1082;","&#1083;","&#1084;","&#1085;","o","&#1087;","&#1088;","&#1089;","&#1090;","&#1091;","&#1092;","&#1093;","&#1094;","&#1095;","&#1096;","&#1096;","&#1097;","&#1100;","&#1099;","&#1100;","&#1101;","&#1102;","&#1103;","",""," ","","","","","","","","Midi","Mmf","Mp3","Wav");
$s = preg_replace ($search, $replace, $s);
return $s;
}
//Ниже расширения файлов которые нужно скрывать. Можешь менять на свои.

$ras1 = ".gif";
$ras2 = ".jpg";
$ras3 = ".mp3";
$ras4 = ".mid";
$ras5 = ".mmf";
$ras6 = ".wav";
$ras7 = ".3gp";
$ras8 = ".jar";
$ras9 = ".zip";
$ras10 = ".rar";
$ras11 = ".sis";
$ras11 = ".php";
/////////////////////////////////////////////////////////////////

$conf["items_per_page"] = 6; //////СКОЛЬКО ЭЛЕМЕНТОВ НА СТРАНИЦУ!
if (!isset($page)) {$page = 0;}
if (isset($p)) {$page = $p-1;}
$total = 0;

if(!($dp = opendir("./"))) die ("Cannot open ./");
$file_array = array();
while ($file = readdir ($dp))
{
if(substr($file,0,1) != '.' and $file != "index.php" and $file != "..")
{
$file_array[] =  $file;
}
}
$file_count = count ($file_array);
sort ($file_array);
?>
<?

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))
{

////////////////////////////////////////
//Тут происходит удаление расширений.

$file1 = $file_name;
$file1 = str_replace("$ras1","",$file1);
$file1 = str_replace("$ras2","",$file1);
$file1 = str_replace("$ras3","",$file1);
$file1 = str_replace("$ras4","",$file1);
$file1 = str_replace("$ras5","",$file1);
$file1 = str_replace("$ras6","",$file1);
$file1 = str_replace("$ras7","",$file1);
$file1 = str_replace("$ras8","",$file1);
$file1 = str_replace("$ras9","",$file1);
$file1 = str_replace("$ras10","",$file1);
$file1 = str_replace("$ras11","",$file1);
$file1 = str_replace("$ras12","",$file1);

$file1 =  trans($file1);//ретранслит
/////////////////////////////////////////

echo "&#8226; <a href=\"$file_name\">$file1</a> (". round(filesize($file_name)/1024,1) . "kb)<br/>";
$total = $total + filesize($file_name);
}

}

echo"________<br/>";

if (($file_count > 0) AND ($page != 0))


{
// previous button
$prev_page = $page -1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$prev_page\">&lt;&lt;&lt;</a>||";
}

if (($file_count > 0) AND ($last_record < $file_count))
{
// next button
$next_page = $page + 1;
echo "<a href=\"".$_SERVER["PHP_SELF"]."?page=$next_page\">&gt;&gt;&gt;</a><br/>";
}

$pages1 = ($file_count/$conf["items_per_page"])+1;
$pages=strtok($pages1,'.');
$pg=$page+1;

echo "<br/>&#x0421;&#x0442;&#x0440;&#x0430;&#x043D;&#x0438;&#x0446;&#x0430;: $pg/$pages<br/>
&#x0412;&#x0441;&#x0435;&#x0433;&#x043E; &#x0444;&#x0430;&#x043B;&#x043E;&#x0432;: $file_count<br/>";
echo "&#x0421;&#x0442;&#x0440;&#x0430;&#x043D;&#x0438;&#x0446;&#x0430;:<br/>";
print "<input name=\"p\" format=\"*N\" size=\"3\"/>";
echo "<br/><a href=\"index.php?page=$(p)&amp;p=$(p)\">&#x041F;&#x0435;&#x0440;&#x0435;&#x0439;&#x0442;&#x0438;</a>
<br/><br/><a href=\"../\">&#x041D;&#x0430;&#x0437;&#x0430;&#x0434;</a>";

}
closedir($dp);
?>

</p></card></wml>