File size: 3.11Kb
<?php
##############################
## WAP-ENGINE ##
##############################
## ##
## Автор : CHUMA ##
## e-mail : [email protected] ##
## WAP : http://wapeng.info ##
## ICQ : 13-14-11 ##
## ##
##############################
## ВЫ НЕ ИМЕЕТЕ ПРАВО ##
## ИЗМЕНЯТЬ КОД СКРИПТА ##
## ДЛЯ ДАЛЬНЕЙШЕГО ##
## РАСПРОСТРАНЕНИЯ ##
##############################
Error_Reporting(E_ALL & ~E_NOTICE);
Error_Reporting (ERROR | WARNING);
extract($HTTP_GET_VARS);
extract($HTTP_POST_VARS);
extract($HTTP_COOKIE_VARS);
extract($HTTP_SERVER_VARS);
extract($HTTP_SESSION_VARS);
session_name("SESID");
session_start();
require ("../../config.php"); # Подключаем настройки сайта. (config.php)
require ("../../themes/$themes.php"); # Вставляем скин сайта.
include_once "tr_win.php";
$strok = 2000;
if ($_GET[file])
{
$file = explode(".","$_GET[file]");
$kat = str_replace(".","",$_GET[kat]);
$kat = str_replace("/","",$kat);
$filewin = tr_to_win($file[0]);
echo "<center>$filewin</center><hr />";
$text = @implode("\r\n",@file("$kat/$_GET[file]"));
$string = substr("$text", $_GET[n], $strok);
$m = $_GET[n] + $strok;
$b = $_GET[n] - $strok;
$string1 = strtr("$string", "<", " ");
print "$string1 <br/>";
$count = strlen($string1);
print "<center>";
if ($b != "-$strok") {print"<a href=\"index.php?n=$b&file=$_GET[file]&kat=$_GET[kat]&view=2\">Назад </a>";}
print "|";
if ($count > $strok-1) {print"<a href=\"index.php?n=$m&file=$_GET[file]&kat=$_GET[kat]&view=2\"> Далее</a>";}
print "</center>";
$katwin = tr_to_win($_GET[kat]);
echo "<hr /><a href=\"index.php?kat=$_GET[kat]&view=1\">В $katwin</a><br />";
}
if ($_GET[view] == 1)
{
$katwin = tr_to_win($_GET[kat]);
$kat = str_replace(".","",$_GET[kat]);
$kat = str_replace("/","",$kat);
echo "<center>$katwin</center>";
$dir = opendir ("$kat");
while ( $file = readdir ($dir))
{
if (( $file != ".") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php") && ($file != "tr_win.php"))
{
$fil = explode(".","$file");
$filewin = tr_to_win($fil[0]);
echo "<div class=\"b\"><a href=\"index.php?file=$file&kat=$_GET[kat]&view=2\">$filewin</a></div>";
}
}
echo "<hr /><div><a href=\"./\">К категориям</a></div><hr />";
}
if(empty($_GET[view]))
{
echo "<center>Библиотека</center>";
echo "Категории<br />";
$dir = opendir (".");
while ( $file = readdir ($dir))
{
if (( $file != ".") && ($file != "..") && ($file != ".htaccess") && ($file != "index.php") && ($file != "tr_win.php") && $file != "kom.php" && $file != "adminkom.php")
{
$filewin = tr_to_win($file);
echo "<div class=\"b\"><a href=\"index.php?kat=$file&view=1\">$filewin</a></div>";
}
}
}
include ("../../templates/foot.php"); # Вставляем низ сайта. (templates/foot.php)
?>