<?php if (!defined('MODULE_FILE')) { die ("You can't access this file directly..."); } require_once("mainfile.php"); $module_name = basename(dirname(__FILE__)); $pagetitle = "IP CrazyDog"; include("header.php"); OpenTable(); echo "страничка редактируется и работает не коректно<br>"; # Mini changelog: # 18.06.02: v1.0 - This script was created fast on one day... # 20.06.02: v1.1 - Fixed a little bug in line 214. # 21.06.02: v1.2 - Added show/ignore filetype filters.. # 28.01.03: v1.3 - Added sorting of the file/dir list... # # For more scripts.. go to http://allseti.ru # Rolf # fix for older versions of PHP. if (!isset($_GET) && !isset($_POST)) { $_GET = @$HTTP_GET_VARS; $_POST = @$HTTP_POST_VARS; $_COOKIE = @$HTTP_COOKIE_VARS; $_SESSION = @$HTTP_SESSION_VARS; $_ENV = @$HTTP_ENV_VARS; $_SERVER = @$HTTP_SERVER_VARS; } $topdir = "f:/фильмы"; // Don't touch this - go to the configuration part! if (empty($_GET["dir"])) $dir="/"; if (!empty($_GET["dir"])) $dir=$_GET["dir"]; $debug = false; // Display debug messages? $ver="1.3"; #################################################### # START OF CONFIGURATION # # Uncomment one of the $topdir configurations or create one yourself! Default listing is ./ # # Most usefull examples: # $topdir = $_SERVER["DOCUMENT_ROOT"]; // This will display the whole webserver directory. # $topdir = "./"; // Current directory and below. # # Note: # Listing files outside the webserver is possible, # but accessing them with this script is not possible. # # Example: # $topdir = "/"; // Linux root directory - Not recomended! # $topdir = "/home/username/public_html/"; // A spesified directory # $topdir = "/home/ftp"; # $topdir = "c:/ftp/"; //win32 envariment? # # # Extra configuration - should not be needed. # $otherlocation = "/path/on/the/web"; //files exist on another location? # $otherlocation = "http://www.server.com/~username/files/"; //files exist on another location? # # ###### # Filter filetypes: # $filetypes = array("gz","zip","php"); # $filetypes = array("inc","bak"); # # $filter = 0; // Only show $filetypes # $filter = 1; // Ignore $filetypes, show the rest. # $sort = true; // Sort the listing: true / false. $sort_type = SORT_REGULAR; # # SORT_REGULAR - compare items normally # SORT_NUMERIC - compare items numerically # SORT_STRING - compare items as strings # END OF CONFIGURATION #################################################### if (!empty($otherlocation)) if ($otherlocation[strlen($otherlocation)-1] != '/') $otherlocation .= '/'; if (empty($otherlocation)) $otherlocation=""; function imgheader() { header("Expires: ".date("D, d M Y H:i:s",mktime(date("H"),date("i"),date("s"),date("m"),date("d")+1,date("Y")))); } function image_1() { imgheader(); header("Content-type: image/gif"); header("Content-length: 120"); echo base64_decode( 'R0lGODlhEgANAKIAAPf39///zpycAP/OnM7OY////wAAAP//nC'. 'wAAAAAEgANAAADRVglzKYwKgFCOEc8CQX5INE0kWCdqHUQ23Jh'. 'cDyw3RsfA7625g3nM54NA9TRJkOiLlj7LXFMZHE6iC5C2FCrYO'. 'h6v19IAgA7'); } function image_2() { imgheader(); header("Content-type: image/gif"); header("Content-length: 109"); echo base64_decode( 'R0lGODlhEgALAKIAAP///8zMzJmZmWZmZgAAAAAAAAAAAAAAAC'. 'H5BAAAAAAALAAAAAASAAsAAAMyCLrcPjDKyEa4ON9B1HCOwHla'. 'BgliB3yChgZtSk6DeMprAC7wCNi0iUpBKBqPxp2SkQAAOw=='); } function image_3() { imgheader(); header("Content-type: image/gif"); header("Content-length: 54"); echo base64_decode( 'R0lGODlhEgANAIAAAP///wAAACH5BAEAAAAALAAAAAASAA0AAA'. 'INhI+py+0Po5y02ovzKQA7'); } function image_4() { imgheader(); header("Content-type: image/gif"); header("Content-length: 4247"); echo base64_decode( 'R0lGODlhpQAXAPcAAP///+v6/vP+/gY2meba1Pn5+dTU1AYvpb'. 'bFt6uumC5RrsfFuce8yrq2xZOXl9Hq1AU0htvc2pS16ubr+7fE'. 'xqmmqcm5tMvE1SM6iwQslfDw8P71/9zo/hY2h/T89Lu3pdbSyu'. 'Xk12N30f7/+TVirNjZ5fz8/BM4lNbl7QMpivX19era5au1thMs'. 'h/7+/qS23IaWxaq2x6247vz/7GqDtu3t7uDg4OX17v/5/6uqs/'. 'j//5unpc3Nzfjr9jhZmrXG2NfL2KeZtW1xq4WauLKpvObm5oel'. 'yHeXuNLJyB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ypwm'. 'uqAnmqAnuqAKupwaOqEGGqEFyk4gCqMVaqERupzmUAMe6k4Aqg'. '0cog392Z9c5Cwm8KBySaNDCqRMyiFceaTQ4wJJmqQfSqU0CqUP'. 'aqByCaRHOqNy2ZW+OaVDKqZfaqVD2qUf+jzJeaRlqqbQo6Zkiq'. 'RTWqDPEz0A6iwDwaRP6qRe9J+MYacEAS3S8yxcMxd3OiBAeqiG'. 'eqh1dEGozuKnjfoeQLqojPoejlqpi9GniZqp8PSftfmnatpFau'. 'qn/smnfco0idqndeqnTVqnggoA8PQeqwqoSzMXtHqo0eNFUfqq'. 'tco0tgqldCGkArGqR/qoXdRFk7oYybqVlIqp0tOpXOOjnSqozd'. 'qrXkSp1RoQADs='); } if (empty($_GET["image"])) $image=0; else $image=$_GET["image"]; if ($image == 1) { image_1(); die(); } if ($image == 2) { image_2(); die(); } if ($image == 3) { image_3(); die(); } if ($image == 4) { image_4(); die(); } function f($size="1",$color="#000000",$face="Verdana") { echo '<font face="'.$face.'" color="'.$color.'" size="'.$size.'">'."\n"; } function endf() { echo '</font>'."\n"; } function br() { return '<br>'."\n"; } function img($nr,$border=0) { #global $_SERVER; #return '<img src="'.$_SERVER["PHP_SELF"].'?image='.$nr.'" #border="'.$border.'">'; } function getext($filename) { $f = strrev($filename); $ext = substr($f, 0, strpos($f,".")); return strrev($ext); } function sw($i) { if ($i) return 0; else return 1; } function listdir($dir="./",$toplevel="./",$otherlocation="") { global $_SERVER,$debug,$filetypes, $filter, $sort, $sort_type; $dir=str_replace('./','/',$dir); $text = ""; if ($dir[strlen($dir)-1] != '/') $dir .= '/'; $path=$toplevel.$dir; $path=str_replace('//','/',$path); $path=str_replace('..','',$path); #echo 'You are here: '.$path.'<br><br>'; if ($debug) {f(1); echo br().'$path = '.$path.br().'$dir = '.$dir.br().br(); endf();} $diren=$dir; if (!is_dir("$path")) die(f(2,"#FF0000")."<b>Error $path is not a directory?</b>"); $files = dir($path) or die("Error reading/opening $path"); while ($a = $files->read()) { if (!empty($a)) $currentArray[] = $a; } if ($sort && (!$sort_type)) sort($currentArray); if ($sort && $sort_type) sort($currentArray,$sort_type); for ($i = 0; $i < count($currentArray); $i++) { $current = $currentArray[$i]; if (($current != "..") && ($current != ".")) { $dir = $diren; # echo "<br>if (is_dir(".$path.$current."))<br>"; if (is_dir($path.$current)) if ($debug) echo "\$dir = $dir - "; if (is_dir($path.$current)) echo '<a href="'.$_SERVER["PHP_SELF"].'?dir='.$dir.''.$current.'">' .img(1).'</a> '."\n" .'<a href="'.$_SERVER["PHP_SELF"].'?dir='.$dir.''.$current.'">' .$current.'</a>'.br(); else { if ($toplevel == "./") $dir = $path; if ($debug) echo "\$dir = $dir - "; $match = sw($filter); if (!empty($filetypes[0])) { $ext=getext($current); $match = $filter; for ($i=0;$i<count($filetypes);$i++) { if ($ext == $filetypes[$i] ) $match = sw($filter); } } else $match = 1; if ($match == 1) echo img(3).' <a href="'.$otherlocation.$dir.$current.'">'.$current.'</a>'.br(); } } }; } f(2); echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <title> каталог фильмов ALLSETI.RU </title> </head> <body bgcolor=FFFFFF> '; echo '<a href="'.$_SERVER["PHP_SELF"].'">'.img(2).'</a> '; echo '<a href="'.$_SERVER["PHP_SELF"].'">Основная папка</a>'.br(); if (empty($topdir)) $topdir = "./"; if ($debug) { f(1); echo "listdir($dir,$topdir,$otherlocation);".br().br(); endf(); } f(2); listdir($dir,$topdir,$otherlocation); endf(); echo '<br><font size="1" face="Verdana">каталог фильмов allseti.ru<br></font> <a href="http://allseti.ru:8080"> <img src="http://allseti.ru/themes/RusNuke2003/images/logo.gif" border="0"> </a></font> </body> </html>'; CloseTable(); include("footer.php"); ?> |