View file files/adm/viget_red.php

File size: 2.91Kb
<?php
Defined('ADMIN_S_S') or die ('Доступ запрещен!!!');
$file_inw = file_get_contents("files/count.txt");
 $file_inw = trim($file_inw);
 if (!is_file("files/fop/$file_inw"))
{
 $fp = fopen ("files/namekat.txt", "r");
 $buffer = fread($fp, filesize("files/namekat.txt"));
 fclose ($fp);
 $count = explode("|", $buffer);
 $i = 0;
  while ($count[$i] != "")
  {
  $i++;
  };
  --$i;
  $file_inw = $count[$i];
  $file_inw=strtr($file_inw,"абвгдеёзийклмнопрстуфхъыэ_",
  "abvgdeeziyklmnoprstufh'iei");
  $file_inw=strtr($file_inw,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ_",
  "ABVGDEEZIYKLMNOPRSTUFH'IEI");
  $file_inw=strtr($file_inw,
  array(
  "ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
  "щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
  "Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
  "Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
  "ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
  ));
  $file_inw = str_replace(" ","_",$file_inw);
  $file_inw = str_replace("\\","_",$file_inw);
  $file_inw = str_replace("\"","_",$file_inw);
  $file_inw = str_replace("'","_",$file_inw);
  $file_inw = str_replace(".","_",$file_inw);
  $file_inw = str_replace("-","_",$file_inw);
  $file_inw = str_replace("/","_",$file_inw);
  $file_inw = str_replace("#","_",$file_inw);
  $file_inw = str_replace("=","_",$file_inw);
  $file_inw = str_replace(">","_",$file_inw);
  $file_inw = str_replace("<","_",$file_inw);
  $rasd_inw = $file_inw ;
   if (filesize("files/rasd/$rasd_inw") > 0)
  {
  $fp = fopen ("files/rasd/$rasd_inw", "r");
  $buffer = fread($fp, filesize("files/rasd/$rasd_inw"));
  fclose ($fp);
  $count = explode("|", $buffer);
  $i=0;
  while ($count[$i] != "")
  {
  $i++;
  };
  --$i;
  $file_inw = $count[$i];
  $file_inw=strtr($file_inw,"абвгдеёзийклмнопрстуфхъыэ_",
  "abvgdeeziyklmnoprstufh'iei");
  $file_inw=strtr($file_inw,"АБВГДЕЁЗИЙКЛМНОПРСТУФХЪЫЭ_",
  "ABVGDEEZIYKLMNOPRSTUFH'IEI");
  $file_inw=strtr($file_inw,
  array(
  "ж"=>"zh", "ц"=>"ts", "ч"=>"ch", "ш"=>"sh",
  "щ"=>"shch","ь"=>"", "ю"=>"yu", "я"=>"ya",
  "Ж"=>"ZH", "Ц"=>"TS", "Ч"=>"CH", "Ш"=>"SH",
  "Щ"=>"SHCH","Ь"=>"", "Ю"=>"YU", "Я"=>"YA",
  "ї"=>"i", "Ї"=>"Yi", "є"=>"ie", "Є"=>"Ye"
  ));
  $file_inw = str_replace(" ","_",$file_inw);
  $file_inw = str_replace("\\","_",$file_inw);
  $file_inw = str_replace("\"","_",$file_inw);
  $file_inw = str_replace("'","_",$file_inw);
  $file_inw = str_replace(".","_",$file_inw);
  $file_inw = str_replace("-","_",$file_inw);
  $file_inw = str_replace("/","_",$file_inw);
  $file_inw = str_replace("#","_",$file_inw);
  $file_inw = str_replace("=","_",$file_inw);
  $file_inw = str_replace(">","_",$file_inw);
  $file_inw = str_replace("<","_",$file_inw);
  $file_inw = str_replace("|","_",$file_inw);
  };
};





  if (is_file("files/fop/$file_inw"))
  {
   $fp = fopen ("files/count.txt", "w+");
   fwrite ($fp,$file_inw);
   fclose ($fp);
  }
   else
   {
   	 echo 'Файла нет.';
   };
?>