Register for your free account! | Forgot your password?

Go Back   elitepvpers > General > Main
You last visited: Today at 05:51

  • Please register to post and access all features, it's quick, easy and FREE!

 

"Eurer" Downloadsystem

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: May 2005
Posts: 4,621
Received Thanks: 101
Ich wusste nicht genau wo ichs hintun soll aber folgendes:

Ich wolte mal den Download bereich mir ansehen und musste festellen das unten
EURER Copyright drinnesteht. Bitte macht das raus oder schreibt dazu dass
es SCORPiON gecodet hat, kann ja nicht angehen, das script ist mir übrigens geläufig weil ich in diversern scene boards aktiv bin.

Hier das originalscript:
Code:
<?
/***************************************************************************

SCORPiON'S iNDEXER 1.0
Copyright ©2004 by SCORPiON
http://bwb.dl.am
[email][/email]

FAQ: Why englisch?
ANSWER: English is spoken by everyone
FAQ: Can i upload this file everywhere?
ANSWER: Yes, only zhing: You must hav a PHP supportet space

NOTE: This script is ONLY to use @ D4RK-FXP.DL.AM!
All other use is not allowed!

mfg SCORPiON


****************************************************************************
** DESCRIPTION FILE FORMAT                        **
****************************************************************************

Hardcore definition:

<descriptionfile> ::= <line>*
<line>       ::= <filename><separationString><description><EOL>
<filename>     ::= <anythingExceptSeparationString>+
<separationString> ::= defined by the $separationString variable, default "\t"
<description>   ::= <anyting>+
<EOL>       ::= "\r\n" | "\n"      // OS dependent


Simple example:

.  This directory contains downloadable files for MyProgram 12.0.
myprogram_12.0.exe  Installer version of MyProgram 12.0 (recommended)
myprogram_12.0.zip  Zip file distribution of MyProgram 12.0
releasenotes.txt  Release notes for MyProgram 12.0


****************************************************************************
** HANDLING SUBDIRECTORY LISTINGS                    **
****************************************************************************

Say you've put the snif index.php into [url]www.yourhost.com/download[/url].
Now somebody makes a request to [url]www.yourhost.com/download/releases[/url]. In
order to deal with this properly, you would have to copy the snif index.php
to that directory, too. But this will prevent the user to go to 
[url]www.yourhost.com/download[/url] from [url]www.yourhost.com/download/releases[/url]
directly by selecting the .. link.

If you have this situation, use the index.php file from the subdirectory
called "subdir" in the snif archive file. All it does is automatically 
forward the user to the parent directory and set URL parameters so that
the real snif will handle the request.

OK, that may be confusing. Again, a simple example:


/download/descript.ion            << descriptions for /download/*.*
/download/index.php             << this file you're reading now, >25 KB
/download/license.txt
/download/notes.txt
/download/releases/bigprogram_2.0.zip
/download/releases/descript.ion       << descriptions for /download/releases/*.*
/download/releases/index.php         << subdir/index.php, <2 KB
/download/releases/nightly/2.1_20031103.zip
/download/releases/nightly/2.1_20031104.zip
/download/releases/nightly/index.php     << subdir/index.php, <2 KB


If a users points his browser to
 [url]www.yourhost.com/download/releases/nightly/[/url]
 
The small index.php will forward him to
 [url]www.yourhost.com/download/releases/?path=nightly/[/url]

And then the index file in that directory will forward him again, this time to
 [url]www.yourhost.com/download/?path=releases/nightly/[/url]

Now we've reached the directory with the real snif (should get a copyright on
that phrase&#59;-)), which will take over and miraculously lists the directory
the user typed as an URL.



/***************************************************************************/
/** SET YOUR CONFIGURATION HERE                     **/
/***************************************************************************/



/************** BASIC SETTINGS *******************************************/
/* These settings configure the most basic functions of snif. You should  */
/* be able to understand them quickly.                   */
/***************************************************************************/

/**
 * Specify which files should be hidden in the file listing using
 * unix/DOS wildcards (? and *).
 * This is case insensitive. This script, the current directory and the
 * description file will automatically be hidden.
 **/
$hiddenFilesWildcards = Array("*.php", "*~");

/**
 * Show sub directories and let the user change to them.
 * It will be impossible to go above the directory this script is in.
 **/
$allowSubDirs = true;

/**
 * Allow the users to download .php files. This will expose the full contents
 * of the downloaded files (including any password used in it). Be careful
 * with this!
 * This only makes sense if you don't hide all .php files.
 **/
$allowPHPDownloads = false;


/**
 * Automatically generate and display thumbnails for image files. This
 * feature requires GDlib 2.0+.
 **/
$useAutoThumbnails = true;


/************** ADVANCED SETTINGS ****************************************/
/* Usually you won't need to change these, but you may have a look if you */
/* want snif to do something you think it can't. Maybe there's a setting  */
/* which lets you do it.                          */
/***************************************************************************/

/**
 * Set the server name to be reported on generated pages. Use this only if
 * your server reports the wrong name if $_SERVER['HTTP_HOST'] (which is 
 * the default) is used.
 **/
$snifServer = $_SERVER['HTTP_HOST'];
//$snifServer = '[url]www.yourdomain.com';[/url]

/**
 * Set the date and time format used for file modified dates. For the syntax
 * of this string, please refer to 
 * http://www.php.net/manual/en/function.date.php
 **/
$snifDateFormat = 'd.m.y';

/**
 * Specify which files should be hidden in the file listing using
 * regular expressions. Do not use expression limiters or modifiers.
 * These patterns will be merged with $hiddenFilesWildcards.
 **/
$hiddenFilesRegex = Array();
 
/**
 * Description file, leave blank for no descriptions.
 **/
$useDescriptionsFrom = "descript.ion";

/**
 * Define the string that should be used to separate file names and
 * descriptions in the description files. Defaults to "\t" (tab).
 **/
$separationString = "\t";

/**
 * Use external images instead of built-in ones. If you set this to
 * true, you should specify each of the $iconForXXX variables below.
 * If you don't, internal images will be used instead.
 **/
$useExternalImages = true;

/**
 * State the filenames for external file icons. Only used if
 * $useExternalImages == true. Paths are relative to the directory of snif.
 * Icon size should be 16x16 pixels, except where noted otherwise.
 * Use an empty string to use the internally stored image for that icon.
 **/
$externalIcons = Array (
  "archive"  => "",
  "binary"  => "",
  "folder"  => "",
  "html"    => "",
  "image"    => "",
  "text"    => "",
  "unknown"  => "",
  "download"  => "",  // 7x16 pixels
  "asc"    => "",    // 5x3 pixels
  "desc"    => ""   // 5x3 pixels
);

/**
 * Filenames in description files are case insensitive. If a file in a
 * directory is called MyProgram.ZIP, adding a description line for 
 * myprogram.zip will be used for this file.
 * If you set this to true, filenames in description files and directories
 * must be exactly the same.
 **/
$descriptionFilenamesCaseSensitive = false;

/**
 * If a directory contains more than this number of files, display it on
 * multiple pages. Useful for very large directories. $usePaging sets the
 * number of files displayed per page. Set to 0 to disable multiple pages.
 **/
$usePaging = 0;

/**
 * Make links to directories in a file listing point directly to that
 * directory. Defaults to false. Set this to true if you want to display
 * individual index files for each directory. If you want to display a
 * subdirectory with snif, copy the subdir/index.php from the snif archive
 * to that directory.
 **/
$directDirectoryLinks = false;

/**
 * Sets the height of thumbnails. Images bigger than this value will be
 * downsized to this height. Smaller images will stay unchanged. Defaults
 * to 50.
 **/
$thumbnailHeight = 50;

/***************************************************************************/
/** REAL CODE STARTS HERE, NO NEED TO CHANGE ANYTHING          **/
/***************************************************************************/


// INITIALISATION

// make sure all the notices don't come up in some configurations
error_reporting (E_ALL ^ E_NOTICE);

$displayError = "";

// safify all GET variables
foreach($_GET AS $key => $value) {
  $_GET[$key] = strip_tags($value);
}

// first of all, security: prevent any unauthorized paths
// if sub directories are forbidden, ignore any path setting
if (!$allowSubDirs) {
  $path = "";
} else {
  $path = $_GET["path"];
  
  // ignore any potentially malicious paths
  $path = safeDirectory($path);
}

// default sorting is by name
if ($_GET["sort"]=="") 
  $_GET["sort"] = "name";

// default order is ascending
if ($_GET["order"]=="") {
  $_GET["order"] = "asc";
} else {
  $_GET["order"] = strtolower($_GET["order"]);
}
  
// add files used by snif to hidden file list
$hiddenFilesWildcards[] = $useDescriptionsFrom;
$hiddenFilesWildcards[] = ".";
$hiddenFilesWildcards[] = basename($_SERVER["PHP_SELF"]);

// build hidden files regular expression
for ($i=0;$i<count($hiddenFilesWildcards);$i++) {
  $translate = Array(
    "." => "\\.",
    "*" => ".*",
    "?" => ".?",
    "+" => "\\+",
    "[" => "\\[",
    "]" => "\\]",
    "(" => "\\(",
    ")" => "\\)",
    "{" => "\\{",
    "}" => "\\}",
    "^" => "\\^",
    "\$" => "\\\$",
    "\\" => "\\\\",
  );
  $hiddenFilesRegex[] = "^".strtr($hiddenFilesWildcards[$i],$translate)."$";
}
// hide .*
$hiddenFilesRegex[] = "^\\.[^.].*$";
$hiddenFilesWholeRegex = "/".join("|",$hiddenFilesRegex)."/i";


// handle image requests
if ($_GET["getimage"]!="") {
  $imagesEncoded = Array(
    "archive" => "R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAAAI3lA+pxxgfUhNKPRAbhimu2kXiRUGeFwIlN47qdlnuarokbG46nV937UO9gDMHsMLAcSYU0GJSAAA7",
    "asc"   => "R0lGODlhBQADAIABAN3d3f///yH5BAEAAAEALAAAAAAFAAMAAAIFTGAHuF0AOw==",
    "binary"  => "R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAAAI0lICZxgYBY0DNyfhAfROrxoVQBo5mpzFih5bsFLoX5iLYWK6xyur5ubPAbhPZrKhSKCmCAgA7",
    "desc"   => "R0lGODlhBQADAIABAN3d3f///yH5BAEAAAEALAAAAAAFAAMAAAIFhB0XC1sAOw==",
    "folder"  => "R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAAAIplI+JwKAJggzuiThl2wbnT3UgWHmjJp5Tqa5py7bhJc/mWW46Z/V+UgAAOw==",
    "html"   => "R0lGODlhEAAQAKIHABsb/2ho/4CA/0BA/zY2/wAAAP///////yH5BAEAAAcALAAAAAAQABAAAANEeFfcrVAVQ6thUdo6S57b9UBgSHmkyUWlMAzCmlKxAZ9s5Q5AjWqGwIAS8OVsNYJxJgDwXrHfQoVLEa7Y6+Wokjq+owQAOw==",
    "image"  => "R0lGODlhEAAQAKIEAK6urmRkZAAAAP///////wAAAAAAAAAAACH5BAEAAAQALAAAAAAQABAAAANCSCTcrVCJQetgUdo6RZ7b9UBgSHnkAKwscEZTy74pG9zuBavA7dOanu+H0gyGxN0RGdClKEjgwvKTlkzFhWOLISQAADs=",
    "text"   => "R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAAAI0lICZxgYBY0DNyfhAfXcuxnWQBnoKMjXZ6qUlFroWLJHzGNtHnat87cOhRkGRbGc8npakAgA7",
    "download" => "R0lGODlhBwAQAIABAAAAAP///yH5BAEAAAEALAAAAAAHABAAAAISjI+pywb6UkQzgHsPls3h2gUFADs=",
    "blank"  => "R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",
    "unknown" => "R0lGODlhEAAQAJECAAAAAP///////wAAACH5BAEAAAIALAAAAAAQABAAAAI1lICZxgYBY0DNyfhAfXcuxnkI1nCjB2lgappld6qWdE4vFtprR+4sffv1ZjwdkSc7KJYUQQEAOw=="
  );
  $imageDataEnc = $imagesEncoded[$_GET["getimage"]];
  if ($imageDataEnc) {
    $maxAge = 31536000; // one year
    doConditionalGet($_GET["getimage"], gmmktime(1,0,0,1,1,2004));
    $imageDataRaw = base64_decode($imageDataEnc);
    Header("Content-Type: image/gif");
    Header("Content-Length: ".strlen($imageDataRaw));
    Header("Cache-Control: public, max-age=$maxAge, must-revalidate");
    Header("Expires: ".createHTTPDate(time()+$maxAge));
    echo $imageDataRaw;
  }
  
  die();
}


// handle thumbnail creation
if ($_GET["thumbnail"]!="") {
  GLOBAL $thumbnailHeight;
  
  $file = safeDirectory($_GET["thumbnail"]);
  doConditionalGet($_GET["thumbnail"],filemtime($file));
  
  $extension = strtolower(substr(strrchr($file, "."), 1));
  switch ($extension) {
    case "gif":    $src = imagecreatefromgif($file); break;
    case "jpg":    // fall through
    case "jpeg":  $src = imagecreatefromjpeg($file); break;
    case "png":    $src = imagecreatefrompng($file); break;
  }
  $srcWidth = imagesx($src);
  $srcHeight = imagesy($src);
  $srcAspectRatio = $srcWidth / $srcHeight;
  
  if ($srcHeight<=$thumbnailHeight) {
    $thumb = $src;
  } else {
    $thumbHeight = $thumbnailHeight;
    $thumbWidth = $thumbHeight * $srcAspectRatio;
    if (function_exists('imagecreatetruecolor')) {
      $thumb = imagecreatetruecolor($thumbWidth, $thumbHeight);
    } else {
      $thumb = imagecreate($thumbWidth, $thumbHeight);
    } 
    imagecopyresampled($thumb, $src, 0, 0, 0, 0, $thumbWidth, $thumbHeight, $srcWidth, $srcHeight);
  }
  
  $maxAge = 3600; // one hour
  Header("Content-Type: image/jpeg");
  Header("Cache-Control: public, max-age=$maxAge, must-revalidate");
  Header("Expires: ".createHTTPDate(time()+$maxAge));
  imagejpeg($thumb);
  die();
}


// handle download requests
if ($_GET["download"]!="") {
  $filename = safeDirectory($path.$_GET["download"]);
  if (
    !file_exists($filename)
    OR fileIsHidden($filename)
    OR (substr(strtolower($filename), -4)==".php" AND !$allowPHPDownloads)) {
    
    Header("HTTP/1.0 404 Not Found");
    $displayError = "File not found: $filename";
  } else {
    doConditionalGet($filename, filemtime($filename));
    Header("Content-Length: ".filesize($filename));
    Header("Content-Type: application/x-download");
    Header("Content-Disposition: attachment; filename=".$_GET["download"]);
    readfile($filename);
    die();
  }
}


// create a HTTP conform date
function createHTTPDate($time) {
  return gmdate("D, d M Y H:i:s", $time)." GMT";
}


// this function is from http://simon.incutio.com/archive/2003/04/23/conditionalGet
function doConditionalGet($file, $timestamp) {
  $last_modified = createHTTPDate($timestamp);
  $etag = '"'.md5($file.$last_modified).'"';
  // Send the headers
  Header("Last-Modified: $last_modified");
  Header("ETag: $etag");
  // See if the client has provided the required headers
  $if_modified_since = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ?
    stripslashes($_SERVER['HTTP_IF_MODIFIED_SINCE']) :
    false;
  $if_none_match = isset($_SERVER['HTTP_IF_NONE_MATCH']) ?
    stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) : 
    false;
  if (!$if_modified_since && !$if_none_match) {
    return;
  }
  // At least one of the headers is there - check them
  if ($if_none_match && $if_none_match != $etag) {
    return; // etag is there but doesn't match
  }
  if ($if_modified_since && $if_modified_since != $last_modified) {
    return; // if-modified-since is there but doesn't match
  }
  // Nothing has changed since their last request - serve a 304 and exit
  Header('HTTP/1.0 304 Not Modified');
  die();
}


function safeDirectory($path) {
  $result = $path;
  if (strpos($path,"..")!==false)
    $result = "";
  if (substr($path,0,1)=="/") {
    $result = "";
  }
  return $result;
}


/**
 * Formats a file's size nicely (750 B, 3.4 KB etc.)
 **/
function niceSize($size) {
  define("SIZESTEP", 1024.0);
  static $sizeUnits = Array("B","KB","MB","GB","TB");
  
  if ($size==="")
    return "";
  
  $unitIndex = 0;
  while ($size>SIZESTEP) {
    $size = $size / SIZESTEP;
    $unitIndex++;
  }
  
  if ($unitIndex==0) {
    return number_format($size, 0)."".$sizeUnits[$unitIndex];
  } else {
    return number_format($size, 1, ".", ",")."".$sizeUnits[$unitIndex];
  }
}

/**
 * Compare two strings or numbers. Return values as strcmp().
 **/
function myCompare($arrA, $arrB, $caseSensitive=false) {
  $a = $arrA[$_GET["sort"]];
  $b = $arrB[$_GET["sort"]];
  
  // sort directories above everything else
  if ($arrA["isDirectory"]!=$arrB["isDirectory"]) {
    $result = $arrB["isDirectory"]-$arrA["isDirectory"];
  } else if ($arrA["isDirectory"] && $arrB["isDirectory"] && ($_GET["sort"]=="type" || $_GET["sort"]=="size")) {
    $result = 0;
  } else {
    if (is_string($a) OR is_string($b)) {
      if (!$caseSensitive) {
        $a = strtoupper($a);
        $b = strtoupper($b);
      }
      $result = strcoll($a,$b);
    } else {
      $result = $a-$b;
    }
  }
  
  if (strtolower($_GET["order"])=="desc") {
    return -$result;
  } else {
    return $result;
  }
}


/**
 * URLEncodes some characters in a string. PHP's urlencode and rawurlencode
 * produce very unsatisfying results for special and reserverd characters in
 * filenames.
 **/
function myEncode($string) {
  // % must be the first, as it is the escape character
  $from = Array("%"," ","#","&");
  $to = Array("%25","%20","%23","%26");
  return str_replace($from, $to, $string);
}


/**
 * Build a URL using new sorting settings.
 **/
function getNewSortURL($newSort) {
  GLOBAL $path;
  $base = $_SERVER["PHP_SELF"];
  $url = $base."?sort=$newSort";
  if ($newSort==$_GET["sort"]) {
    if ($_GET["order"]=="asc" OR $_GET["order"]=="") {
      $url.= "&order=desc";
    }
  }
  if ($path!="") {
    $url.= "&path=$path";
  }
  return $url;
}

/**
 * Determine a file's file type based on its extension.
 **/
function getFileType($extension, $isDir) {
  // put any additional extensions in here
  static $fileTypes = Array(
    "html"    => Array("html","htm"),
    "image"    => Array("gif","jpg","jpeg","png","tif","tiff","bmp","art"),
    "text"    => Array("asp","c","cfg","cpp","css","csv","conf","cue","diz","h","inf","ini","java","js","log","nfo","php","phps","pl","rdf","rss","rtf","sql","txt","vbs","xml"),
    "binary"  => Array("asf","au","avi","bin","class","divx","doc","exe","mov","mpg","mpeg","mp3","ogg","ogm","pdf","ppt","ps","rm","swf","wmf","wmv","xls"),
    "archive"  => Array("ace","arc","bz2","cab","gz","lha","jar","rar","sit","tar","tbz2","tgz","z","zip","zoo")
  );
  static $extensions = null;

  if ($extensions==null) {
    $extensions = Array();
    foreach($fileTypes AS $keyType => $value) {
      foreach($value AS $ext) $extensions[$ext] = $keyType;
    }
  }

  if ($isDir)
    return "folder";
  
  $type = $extensions[strtolower($extension)];
  if ($type=="") {
    return "unknown";
  } else {
    return $type;
  }
}

function getIcon($fileType) {
  GLOBAL $useExternalImages, $externalIcons;
  if ($useExternalImages && $externalIcons[$fileType]!="") {
    return $externalIcons[$fileType];
  } else {
    return $_SERVER["PHP_SELF"]."?getimage=$fileType";
  }
}

// checks if a file is hidden from view
function fileIsHidden($filename) {
  GLOBAL $hiddenFilesWholeRegex;
  return preg_match($hiddenFilesWholeRegex,$filename);
}

/**
 * Gets a file's description from the description array.
 **/
function getDescription($filename) {
  GLOBAL $descriptions, $descriptionFilenamesCaseSensitive;
  
  if (!$descriptionFilenamesCaseSensitive) {
    $filename = strtolower($filename);
  }
  return $descriptions[$filename];
}

function getPageLink($startNumber, $linkText, $linkTitle="") {
  GLOBAL $snifServer, $path;
  $url = "http://".$snifServer.$_SERVER["PHP_SELF"]."?path=".$path."&sort=".$_GET["sort"]."&order=".$_GET["order"]."&start=".$startNumber;
  if ($linkTitle!="") {
    $titleAttribute = " title=\"$linkTitle\"";
  } else {
    $titleAttribute = "";
  }
  return "<a href=\"$url\"$titleAttribute>$linkText</a>";
}

function getPagingHeader() {
  GLOBAL $pageStart, $usePaging, $pagingNumberOfPages, $pagingActualPage, $pageNumber, $files;
  static $displayPages = Array();
  if (count($displayPages)==0) {
    $displayPages[] = 0;
    for ($i=$pagingActualPage-1; $i<$pagingActualPage+3; $i++) {
      if ($i>=0 && $i<$pagingNumberOfPages) {
        $displayPages[] = $i;
      }
    }
    $displayPages[] = $pagingNumberOfPages-1;
    $displayPages = array_unique($displayPages);
  }
  
  $header = "pages";
  if ($pageStart>0) {
    $header.= getPageLink($pageStart-$usePaging, "«", "previous");
  }
  if ($pageStart+$usePaging<count($files)) {
    $header.= getPageLink($pageStart+$usePaging, "»", "next");
  }
  foreach($displayPages as $i => $pageNumber) {
    if ($pageNumber-$displayPages[$i-1] > 1) {
      $header.= ".. ";
    }
    if ($pageNumber!=$pagingActualPage) {
      $header.= getPageLink($pageNumber*$usePaging, $pageNumber+1);
    } else {
      $header.= "<span class=\"snWhite\">".($pageNumber+1)."</span>";
    }
  }
  
  return $header;
}

function getPathLink($directory) {
  GLOBAL $directDirectoryLinks;
  if ($directDirectoryLinks) {
    return $directory."/";
  } else {
    return $_SERVER["PHP_SELF"]."?path=".urlEncode($directory)."/";
  }
}



// change directory
// must be done before description file is parsed
if ($path!="") {
  if (!@chdir($path)) {
    $displayError = "$path is not a subdirectory of the current directory.";
    $path = "";
  }
} 
$dir = dir(".");

// parsing description file
$descriptions = Array();
if ($useDescriptionsFrom!="") {
  $descriptionsFile = @file($useDescriptionsFrom);
  if ($descriptionsFile!==false) {
    for ($i=0;$i<count($descriptionsFile);$i++) {
      $d = explode($separationString,$descriptionsFile[$i]);
      if (!$descriptionFilenamesCaseSensitive) {
        $d[0] = strtolower($d[0]);
      }
      $descriptions[$d[0]] = join($separationString, array_slice($d, 1));
    }
  }
}

// build a two dimensional array containing the files in the chosen directory and their meta data
$files = Array();
while($entry = $dir->read()) {
  // if the filename matches one of the hidden files wildcards, skip the file
  if (fileIsHidden($entry))
    continue;
    
  // if the file is a directory and if directories are forbidden, skip it
  if (!$allowSubDirs AND is_dir($entry))
    continue;
  
  $f = Array();

  $f["name"] = $entry;
  $f["isDownloadable"] = (substr(strtolower($entry), -4)!=".php") || $allowPHPDownloads;
  $f["isDirectory"] = is_dir($entry);
  $fDate = @filemtime($entry);
  $f["date"] = $fDate;
  $f["fullDate"] = date("r", $fDate);
  $f["shortDate"] = date($snifDateFormat, $fDate);
  $f["description"] = getDescription($entry);
  if (is_dir($entry)) {
    &#036;f&#91;&#34;type&#34;&#93; = &#34;<DIR>&#34;;
    &#036;f&#91;&#34;size&#34;&#93; = &#34;&#34;;
    &#036;f&#91;&#34;nicesize&#34;&#93; = &#34;&#34;;
    
    // building the link
    if &#40;&#036;entry==&#34;..&#34;&#41; {
      // strip the last directory from the path
      &#036;pathArr = explode&#40;&#34;/&#34;,&#036;path&#41;;
      &#036;link = implode&#40;&#34;/&#34;,array_slice&#40;&#036;pathArr,0,count&#40;&#036;pathArr&#41;-2&#41;&#41;;
      
      // if there is no path set, don&#39;t add it to the link
      if &#40;&#036;link==&#34;&#34;&#41; {
        // we&#39;re already in &#036;baseDir, so skip the file
        if &#40;&#036;path==&#34;&#34;&#41;
          continue;
        &#036;f&#91;&#34;link&#34;&#93; = &#036;_SERVER&#91;&#34;PHP_SELF&#34;&#93;;
      } else {
        &#036;link.= &#34;/&#34;;
        &#036;f&#91;&#34;link&#34;&#93; = &#036;_SERVER&#91;&#34;PHP_SELF&#34;&#93;.&#34;?path=&#34;.urlEncode&#40;&#036;link&#41;;
      }
    } else {
      &#036;f&#91;&#34;link&#34;&#93; = getPathLink&#40;&#036;path.&#036;entry&#41;;
    }
  } else {
    if &#40;is_link&#40;&#036;entry&#41;&#41; {
      &#036;linkTarget = readlink&#40;&#036;entry&#41;;
      &#036;pi = pathinfo&#40;&#036;linkTarget&#41;;
      &#036;scriptDir = dirname&#40;&#036;_SERVER&#91;&#34;SCRIPT_FILENAME&#34;&#93;&#41;;
      if &#40;strpos&#40;&#036;pi&#91;&#34;dirname&#34;&#93;, &#036;scriptDir&#41;===0&#41; {
        &#036;f&#91;&#34;type&#34;&#93; = &#34;<LINK>&#34;;
        // links have no date, so take the target&#39;s date
        &#036;f&#91;&#34;date&#34;&#93; = filemtime&#40;&#036;linkTarget&#41;;
        &#036;f&#91;&#34;link&#34;&#93; = &#036;path.urlencode&#40;substr&#40;&#036;linkTarget, strlen&#40;&#036;scriptDir&#41;+1&#41;&#41;;
      } else {
        // link target is outside of script directory, so skip it
        continue;
      }
    } else {
      &#036;fSize = @filesize&#40;&#036;entry&#41;;
      &#036;f&#91;&#34;size&#34;&#93; = &#036;fSize;
      &#036;f&#91;&#34;fullSize&#34;&#93; = number_format&#40;&#036;fSize,0,&#34;.&#34;,&#34;,&#34;&#41;;
      &#036;f&#91;&#34;niceSize&#34;&#93; = nicesize&#40;&#036;fSize&#41;;
      &#036;pi = pathinfo&#40;&#036;entry&#41;;
      &#036;f&#91;&#34;type&#34;&#93; = &#036;pi&#91;&#34;extension&#34;&#93;;
      &#036;f&#91;&#34;link&#34;&#93; = myEncode&#40;&#036;path.&#036;entry&#41;;
    }
  }
  &#036;f&#91;&#34;filetype&#34;&#93; = getFileType&#40;&#036;f&#91;&#34;type&#34;&#93;, is_dir&#40;&#036;entry&#41;&#41;;
  &#036;f&#91;&#34;icon&#34;&#93; = getIcon&#40;&#036;f&#91;&#34;filetype&#34;&#93;&#41;;
  if &#40;&#036;useAutoThumbnails && &#036;f&#91;&#34;filetype&#34;&#93;==&#34;image&#34;&#41; {
    &#036;f&#91;&#34;thumbnail&#34;&#93; = &#34;&#60;img src=&#092;&#34;&#34;.&#036;PHP_SELF.&#34;?thumbnail=&#34;.&#036;path.&#036;f&#91;&#34;name&#34;&#93;.&#34;&#092;&#34;/&#62;&#34;;
  }
  &#036;files&#91;&#93; = &#036;f;
}

usort&#40;&#036;files, &#34;myCompare&#34;&#41;;


&#036;pagingInEffect = &#036;usePaging&#62;0 && count&#40;&#036;files&#41;&#62;&#036;usePaging;
if &#40;&#036;usePaging&#62;0&#41; {
  &#036;pageStart = &#036;_GET&#91;&#34;start&#34;&#93;;
  if &#40;&#036;pageStart==&#34;&#34; || &#036;pageStart&#60;0 || &#036;pageStart&#62;count&#40;&#036;files&#41;&#41;
    &#036;pageStart = 0;
  &#036;pagingActualPage = floor&#40;&#036;pageStart / &#036;usePaging&#41;;
  &#036;pagingNumberOfPages = ceil&#40;count&#40;&#036;files&#41; / &#036;usePaging&#41;;
} else {
  &#036;pageStart = 0;
  &#036;usePaging = count&#40;&#036;files&#41;;
}
&#036;pageEnd = min&#40;count&#40;&#036;files&#41;,&#036;pageStart+&#036;usePaging&#41;;


&#036;columns = 4;
if &#40;&#036;useDescriptionsFrom&#33;=&#34;&#34;&#41;
  &#036;columns++;

echo &#34;&#60;?xml version=&#092;&#34;1.0&#092;&#34; encoding=&#092;&#34;UTF-8&#092;&#34;?&#62;&#34;;
?&#62;

&#60;&#33;DOCTYPE html PUBLIC &#34;-//W3C//DTD XHTML 1.1//EN&#34; &#34;http&#58;//www.w3.org/TR/xhtml11/DTD/xhtml11.dtd&#34;&#62;
&#60;html xmlns=&#34;http&#58;//www.w3.org/1999/xhtml&#34;&#62;
  &#60;head&#62;
    &#60;title&#62;Index of &#60;?echo htmlentities&#40;dirname&#40;&#036;_SERVER&#91;&#34;PHP_SELF&#34;&#93;&#41;.&#34;/&#34;.&#036;path&#41;;?&#62;&#60;/title&#62;
    &#60;style type=&#34;text/css&#34;&#62;
      .snif * {
        font-family&#58; Tahoma, Sans-Serif;
        font-size&#58; 10pt;
      }
      .snif img {
        border&#58;none;
      }
      .snif a {
        text-decoration&#58; none;
      }
      .snif a&#58;hover {
        text-decoration&#58; underline;
      }
      body.snif {
        background&#58; #ffffff;
      }
      table.snif {
        border&#58; 1px solid #444444;
      }
      table.snif td {
        padding-left&#58; 10px;
        padding-right&#58; 10px;
      }
      td.snifDir {
        font-weight&#58; bold;
        color&#58; #ffffff;
        background-color&#58; #000000;
        padding-top&#58; 3px;
        padding-bottom&#58; 3px;
      }
      td.snifDir a {
        color&#58;white;
      }
      tr.snifHeading, td.snifHeading, td.snifHeading a {
        font-weight&#58; bold;
        color&#58; #dddddd;
        background-color&#58; #444444;
        padding-top&#58; 3px;
        padding-bottom&#58; 3px;
      }
      tr.snF td {
        color&#58; #444444;
        padding-top&#58; 2px;
        padding-bottom&#58; 2px;
        vertical-align&#58; top;
        padding-left&#58; 10px;
        padding-right&#58; 10px;
        white-space&#58;nowrap;
      }
      tr.snF td a {
        color&#58; #000000;
      }
      tr.snF td a&#58;hover {
        background-color&#58; #bbbbee;
      }
      tr.snifEven {
        background-color&#58; #eeeeee;
      }
      tr.snifOdd {
        background-color&#58; #dddddd;
      }
      .snifCopyright * {
        color&#58; #bbbbbb;
        font-size&#58; 8pt;
      }
      .snifSmaller {
        font-weight&#58; normal;
        font-size&#58; 8pt;
      }
      .snWhite {
        color&#58; white;
      }
      .snW {
        white-space&#58;normal;
      }
    &#60;/style&#62;
  &#60;/head&#62;
&#60;body class=&#34;snif&#34;&#62;
&#60;?
if &#40;&#036;displayError&#33;=&#34;&#34;&#41; {
  echo &#34;&#60;b style=&#092;&#34;color&#58;red&#092;&#34;&#62;&#036;displayError&#60;/b&#62;&#60;br/&#62;&#60;br/&#62;&#34;;
}
?&#62;
&#60;table cellpadding=&#34;0&#34; cellspacing=&#34;0&#34; class=&#34;snif&#34;&#62;
  &#60;tr&#62;
    &#60;td class=&#34;snifDir&#34; colspan=&#34;&#60;?echo &#036;columns?&#62;&#34;&#62;
      &#60;?
      &#036;baseDirname = &#036;snifServer.htmlentities&#40;dirname&#40;&#036;_SERVER&#91;&#34;PHP_SELF&#34;&#93;&#41;&#41;;
      &#036;pathToSnif = explode&#40;&#34;/&#34;,&#036;baseDirname&#41;;
      echo &#34;http&#58;//&#34;.join&#40;&#34;/&#34;,array_slice&#40;&#036;pathToSnif, 0, -1&#41;&#41;.&#34;/&#34;;
      echo &#34;&#60;a href=&#092;&#34;&#34;.dirname&#40;&#036;_SERVER&#91;&#34;PHP_SELF&#34;&#93;&#41;.&#34;&#092;&#34;&#62;&#34;.join&#40;&#34;/&#34;,array_slice&#40;&#036;pathToSnif, -1&#41;&#41;.&#34;&#60;/a&#62;&#34;;
      &#036;pathArr = explode&#40;&#34;/&#34;,&#036;path&#41;;
      for &#40;&#036;i=0; &#036;i&#60;count&#40;&#036;pathArr&#41;-1; &#036;i++&#41; {
        &#036;dirLink = getPathLink&#40;join&#40;&#34;/&#34;,array_slice&#40;&#036;pathArr, 0, &#036;i+1&#41;&#41;&#41;;
        echo &#34;/&#60;a href=&#092;&#34;&#036;dirLink&#092;&#34;&#62;&#34;.&#036;pathArr&#91;&#036;i&#93;.&#34;&#60;/a&#62;&#34;;
      }
      ?&#62;&#60;br/&#62;
      &#60;span class=&#34;snifSmaller&#34;&#62;&#60;?echo &#036;descriptions&#91;&#34;.&#34;&#93;;?&#62;&#60;/span&#62;
    &#60;/td&#62;
  &#60;/tr&#62;
  &#60;?
  if &#40;&#036;pagingInEffect&#41; {
  ?&#62;
  &#60;tr class=&#34;snifHeading&#34;&#62;
    &#60;td class=&#34;snifHeading&#34; colspan=&#34;&#60;?echo &#036;columns?&#62;&#34;&#62;
      &#60;?
      echo getPagingHeader&#40;&#41;;
      ?&#62;
    &#60;/td&#62;
  &#60;/tr&#62;
  &#60;?
  }
  ?&#62;
  &#60;tr class=&#34;snifHeading&#34;&#62;
    &#60;td class=&#34;snifHeading&#34;&#62;
      &#60;img src=&#34;&#60;?echo &#036;PHP_SELF?&#62;?getimage=blank&#34; alt=&#34;&#34; width=&#34;30&#34; height=&#34;16&#34; style=&#34;vertical-align&#58;middle;&#34;/&#62;&#60;a href=&#34;&#60;?echo getNewSortURL&#40;&#34;name&#34;&#41;;?&#62;&#34;&#62;Name&#60;/a&#62;
      &#60;?
      &#036;sort = &#036;_GET&#91;&#34;sort&#34;&#93;;
      if &#40;&#036;sort==&#34;name&#34;&#41;
        echo &#34;&#60;img src=&#092;&#34;&#34;.getIcon&#40;&#036;_GET&#91;&#34;order&#34;&#93;&#41;.&#34;&#092;&#34; width=&#092;&#34;5&#092;&#34; height=&#092;&#34;3&#092;&#34; style=&#092;&#34;vertical-align&#58;middle;&#092;&#34; alt=&#092;&#34;&#34;.&#036;_GET&#91;&#34;order&#34;&#93;.&#34;&#092;&#34;/&#62;&#34;;
      ?&#62;
    &#60;/td&#62;
    &#60;td class=&#34;snifHeading&#34;&#62;
      &#60;a href=&#34;&#60;?echo getNewSortURL&#40;&#34;type&#34;&#41;;?&#62;&#34;&#62;Typ&#60;/a&#62;
      &#60;?
      if &#40;&#036;sort==&#34;type&#34;&#41;
        echo &#34;&#60;img src=&#092;&#34;&#34;.getIcon&#40;&#036;_GET&#91;&#34;order&#34;&#93;&#41;.&#34;&#092;&#34; width=&#092;&#34;5&#092;&#34; height=&#092;&#34;3&#092;&#34; style=&#092;&#34;vertical-align&#58;middle;&#092;&#34; alt=&#092;&#34;&#34;.&#036;_GET&#91;&#34;order&#34;&#93;.&#34;&#092;&#34;/&#62;&#34;;
      ?&#62;
    &#60;/td&#62;
    &#60;td class=&#34;snifHeading&#34; align=&#34;right&#34;&#62;
      &#60;?
      if &#40;&#036;sort==&#34;size&#34;&#41;
        echo &#34;&#60;img src=&#092;&#34;&#34;.getIcon&#40;&#036;_GET&#91;&#34;order&#34;&#93;&#41;.&#34;&#092;&#34; width=&#092;&#34;5&#092;&#34; height=&#092;&#34;3&#092;&#34; style=&#092;&#34;vertical-align&#58;middle;&#092;&#34; alt=&#092;&#34;&#34;.&#036;_GET&#91;&#34;order&#34;&#93;.&#34;&#092;&#34;/&#62;&#34;;
      ?&#62;
      &#60;a href=&#34;&#60;?echo getNewSortURL&#40;&#34;size&#34;&#41;;?&#62;&#34;&#62;Grösse&#60;/a&#62;
    &#60;/td&#62;
    &#60;td class=&#34;snifHeading&#34;&#62;
      &#60;a href=&#34;&#60;?echo getNewSortURL&#40;&#34;date&#34;&#41;;?&#62;&#34;&#62;Datum&#60;/a&#62;
      &#60;?
      if &#40;&#036;sort==&#34;date&#34;&#41;
        echo &#34;&#60;img src=&#092;&#34;&#34;.getIcon&#40;&#036;_GET&#91;&#34;order&#34;&#93;&#41;.&#34;&#092;&#34; width=&#092;&#34;5&#092;&#34; height=&#092;&#34;3&#092;&#34; style=&#092;&#34;vertical-align&#58;20%;&#092;&#34; alt=&#092;&#34;&#34;.&#036;_GET&#91;&#34;order&#34;&#93;.&#34;&#092;&#34;/&#62;&#34;;
      ?&#62;
    &#60;/td&#62;
    &#60;?
    if &#40;&#036;useDescriptionsFrom&#33;=&#34;&#34;&#41; {
    ?&#62;
    &#60;td class=&#34;snifHeading&#34;&#62;Beschreibung&#60;/td&#62;
    &#60;?
    }
    ?&#62;
  &#60;/tr&#62;
  &#60;?
  for &#40;&#036;i=&#036;pageStart;&#036;i&#60;&#036;pageEnd;&#036;i++&#41; {
  ?&#62;
  &#60;tr class=&#34;snF &#60;?echo &#40;&#036;i%2==0&#41; ? &#34;snifEven&#34; &#58; &#34;snifOdd&#34;?&#62;&#34;&#62;
    &#60;td&#62;&#60;?
      if &#40;&#036;files&#91;&#036;i&#93;&#91;&#34;isDirectory&#34;&#93; OR &#33;&#036;files&#91;&#036;i&#93;&#91;&#34;isDownloadable&#34;&#93;&#41; {
      ?&#62;&#60;img src=&#34;&#60;?echo &#036;PHP_SELF?&#62;?getimage=blank&#34; alt=&#34;&#34; width=&#34;7&#34; height=&#34;16&#34; style=&#34;vertical-align&#58;middle;&#34;/&#62;
      &#60;?
      } else {
      ?&#62;&#60;a href=&#34;&#60;?echo &#036;PHP_SELF?&#62;?path=&#60;?echo rawurlencode&#40;&#036;path&#41;?&#62;&amp;download=&#60;?echo rawurlencode&#40;&#036;files&#91;&#036;i&#93;&#91;&#34;name&#34;&#93;&#41;;?&#62;&#34;&#62;&#60;img src=&#34;&#60;?echo getIcon&#40;&#34;download&#34;&#41;?&#62;&#34; alt=&#34;download&#34; title=&#34;download&#34; width=&#34;7&#34; height=&#34;16&#34; style=&#34;vertical-align&#58;middle;&#34;/&#62;&#60;/a&#62;
      &#60;?
      }
      ?&#62;&#60;a href=&#34;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;link&#34;&#93;;?&#62;&#34;&#62;&#60;img src=&#34;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;icon&#34;&#93;?&#62;&#34; alt=&#34;&#34; title=&#34;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;filetype&#34;&#93;?&#62;&#34; width=&#34;16&#34; height=&#34;16&#34; style=&#34;vertical-align&#58;middle;&#34;/&#62;&#60;?echo htmlentities&#40;&#036;files&#91;&#036;i&#93;&#91;&#34;name&#34;&#93;&#41;;?&#62;&#60;/a&#62;
    &#60;/td&#62;
    &#60;td&#62;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;type&#34;&#93;;?&#62;&#60;/td&#62;
    &#60;td align=&#34;right&#34;&#62;&#60;span title=&#34;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;fullSize&#34;&#93;;?&#62; Bytes&#34;&#62;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;niceSize&#34;&#93;;?&#62;&#60;/span&#62;&#60;/td&#62;
    &#60;td&#62;&#60;span title=&#34;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;fullDate&#34;&#93;;?&#62;&#34;&#62;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;shortDate&#34;&#93;;?&#62;&#60;/span&#62;&#60;/td&#62;
    &#60;?
    if &#40;&#036;useDescriptionsFrom&#33;=&#34;&#34;&#41; {
    ?&#62;&#60;td class=&#34;snW&#34;&#62;&#60;?echo &#036;files&#91;&#036;i&#93;&#91;&#34;description&#34;&#93;;?&#62;
    &#60;?
    if &#40;&#036;files&#91;&#036;i&#93;&#91;&#34;filetype&#34;&#93;==&#34;image&#34;&#41; {
      ?&#62;
      &#60;img src=&#34;&#60;?echo &#036;PHP_SELF?&#62;?thumbnail=&#60;?echo &#036;path.&#036;files&#91;&#036;i&#93;&#91;&#34;name&#34;&#93;?&#62;&#34; alt=&#34;&#34;/&#62;
      &#60;?
    }
    ?&#62;&#60;/td&#62;&#60;?
    }
    ?&#62;
  &#60;/tr&#62;&#60;?
  }
  if &#40;&#036;pagingInEffect&#41; {
  ?&#62;
  &#60;tr class=&#34;snifHeading&#34;&#62;
    &#60;td class=&#34;snifHeading&#34; colspan=&#34;&#60;?echo &#036;columns?&#62;&#34;&#62;
      &#60;?
      echo getPagingHeader&#40;&#41;;
      ?&#62;
    &#60;/td&#62;
  &#60;/tr&#62;
&#60;?
}
?&#62;
&#60;/table&#62;
&#60;/body&#62;
&#60;/html&#62;



Maybe It's Maybelline is offline  
Old   #2
 
elite*gold: 0
Join Date: Mar 2005
Posts: 363
Received Thanks: 0
nix besseres zu tun als hier nur nach "fehler" zu suchen?


Skifryser is offline  
Old   #3
 
elite*gold: 209
The Black Market: 135/1/0
Join Date: Jul 2003
Posts: 16,612
Received Thanks: 17,573
wenn schon am klugscheissen bist dann bitte richtig..

1. hat das nicht scorpion gecoded
2. is niergends n copyright von uns drin O_o wir betiteln unsere download area als "elitepvpers.com download center" bzw früher "elitepvpers.com download system"

wenn dein scorpion also rl nich Kai Blankenhorn heisst (was ich bezweifle da in dem obigen script ein copyright style angelegt ist welcher nicht benutzt wird) solltest dem erstmal stress machen, weshalb das snif copyright in unserer version entfernt wurde weiss ich nicht, lässt sich aber nachtragen sobald zeit da is und die dame ausdrücklich darauf besteht

p.s. mit ner freundlichen pm lässt sich sowas meist besser lösen, dann reagieren wir auch entsprechend freundlich ;p
Lowfyr is offline  
Old   #4
 
elite*gold: 0
Join Date: May 2005
Posts: 4,621
Received Thanks: 101
Quote:
Originally posted by Skifryser@May 13 2005, 19:29
nix besseres zu tun als hier nur nach "fehler" zu suchen?
Wieso nach Fehlern zu suchen? Wenn ich hier nach Fehlern such würde wäre hier was ganz anderes los.


@Lowfyr:
Also gut anscheinend hatte es dann SCORPiON geklaut, naja ist auch irgendwie egal da er kein internet mehr hatt durch das liebe BKA.
Maybe It's Maybelline is offline  
Closed Thread



« Previous Thread | Next Thread »

Similar Threads
Welcher "Autofarmer" ist eurer meinung nach der beste und der auch Funktioniert
Hallo kann mir jemand das sagen ?? ich hätt gerne einen, der zu den mobs hinrennt und dort sie auch angreift kann mir das jemand sagen kommt mir...
7 Replies - Metin2 Main - Discussions / Questions



All times are GMT +1. The time now is 05:51.


Powered by vBulletin®
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy
Copyright ©2016 elitepvpers All Rights Reserved.