Просмотр файла files/log/files.php

Размер файла: 3.15Kb
<?
Defined('INDEX_S_S') or die ('Доступ запрещен!!!');
if ($_SESSION[is_name] != "" and ($_SESSION[login] != "")) echo '<a href="/?pg=add_file.php">Добавить файл</a>';
echo '<hr>';

 if ($_GET[pokas] < 1 )
 {
 $fp = fopen ("files/namekat.txt", "r");
 $buffer = fread($fp, filesize("files/namekat.txt"));
 fclose ($fp);
 $count = explode("|", $buffer);
 echo 'Разделы:<br />';
 $i=0;
 while ($count[$i] != "")
 {
  $file_s = $count[$i];
  $file_s=strtr($file_s,"абвгдеёзийклмнопрстуфхъыэ_",
  "abvgdeeziyklmnoprstufh'iei");
  $file_s=strtr($file_s,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ_",
  "ABVGDEEZIYKLMNOPRSTUFH'IEI");
  $file_s=strtr($file_s,
  array(
  "ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
  "щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
  "Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
  "Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
  "ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
  ));
  $file_s = str_replace(" ","_",$file_s);
  $file_s = str_replace("\\","_",$file_s);
  $file_s = str_replace("\"","_",$file_s);
  $file_s = str_replace("'","_",$file_s);
  $file_s = str_replace(".","_",$file_s);
  $file_s = str_replace("-","_",$file_s);
  $file_s = str_replace("/","_",$file_s);
  $file_s = str_replace("#","_",$file_s);
  $file_s = str_replace("=","_",$file_s);
  $file_s = str_replace(">","_",$file_s);
  $file_s = str_replace("<","_",$file_s);
  $rasd_inc = $file_s ;
 echo '------------<br />';
 echo '<a href="/?pg=Fayloviy_arhiv.php&rasd='.$rasd_inc.'&pokas=1">'.$count[$i].'</a>';
 echo '<br />';
 readfile("files/count/$rasd_inc.txt");
 echo '<br />';
 $i++;
 };
 }
 elseif ($_GET[pokas] < 2)
 {
 if (filesize("files/rasd/$_GET[rasd]") > 0)
 {
  $fp = fopen ("files/rasd/$_GET[rasd]", "r");
  $buffer = fread($fp, filesize("files/rasd/$_GET[rasd]"));
  fclose ($fp);
  $count = explode("|", $buffer);
  echo 'Файлы:<br />';
  $i=0;
  while ($count[$i] != "")
  {
  $file_s = $count[$i];
  $file_s=strtr($file_s,"абвгдеёзийклмнопрстуфхъыэ_",
  "abvgdeeziyklmnoprstufh'iei");
  $file_s=strtr($file_s,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ_",
  "ABVGDEEZIYKLMNOPRSTUFH'IEI");
  $file_s=strtr($file_s,
  array(
  "ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
  "щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
  "Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
  "Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
  "ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
  ));
  $file_s = str_replace(" ","_",$file_s);
  $file_s = str_replace("\\","_",$file_s);
  $file_s = str_replace("\"","_",$file_s);
  $file_s = str_replace("'","_",$file_s);
  $file_s = str_replace(".","_",$file_s);
  $file_s = str_replace("-","_",$file_s);
  $file_s = str_replace("/","_",$file_s);
  $file_s = str_replace("#","_",$file_s);
  $file_s = str_replace("=","_",$file_s);
  $file_s = str_replace(">","_",$file_s);
  $file_s = str_replace("<","_",$file_s);
  $file_s = str_replace("|","_",$file_s);
  $file_inc = $file_s ;
  echo '------------<br />';
  echo '<a href="/?pg=Fayloviy_arhiv.php&file_inc='.$file_inc.'&pokas=2">'.$count[$i].'</a>';
  echo '<br />';
  $i++;
  };
 }
 else
 echo 'Файлов еще нет';
 }
 elseif ($_GET[pokas] < 3)
 {
 	include('files/log/file_info.php');
 };

?>