Main Menu
Languages
EnglishÓêðà¿íñüêàÐóññêèé
Friends
Sponsors
Google Site Search
I recommend
Partners
Buttons & Counters
Site Statistics Valid HTML 4.01 Transitional! Valid CSS! Hosted by firstVDS.ru Powered by PHP eA logo Search Engine Optimization and Free Submission Óêðàèíñêèé ìåäèà-ïîðòàë
Source of /misc/listdir.php
 
<?php
/*
 * Directory Listing Script v0.5
 *
 * (c) 2006 L¸ppa <lacontacts[at]gmail[dot]com>
 *
 * Site: http://www.leppsville.kiev.ua
 *
 */

    
require("../config.php");

    if (
$_SERVER["REDIRECT_STATUS"] == 403) {
//        header("HTTP/1.1 200 OK",true,200);
        
header("Status: 200 OK");
        
$dir preg_match("/\\/$/",$_SERVER["REQUEST_URI"]) ? eregi_replace("^/","",$_SERVER["REQUEST_URI"]) : eregi_replace("^/","",dirname($_SERVER["REQUEST_URI"]))."/";
    } else {
        
$dir eregi_replace($root,"",dirname($_SERVER["SCRIPT_FILENAME"])."/");
//        print_r($_SERVER);
    
}

    
$mtpl = new COBTemplate($root.$templates."index.tpl");

    
prepare($mtpl,$text_folder." /".$dir);

    
// Page contents
    
$mtpl->data("Contents");

    echo 
$text_folder." <b>/".$dir."</b>\n<div class=\"hr\">&nbsp;</div>";

    if (
preg_match("/^misc\\//",$dir) != 0) {
        echo 
"<table class=\"noborder\">\n"
            
."<tr><th>name</th><th></th><th>type</th><th></th><th>size</th></tr>\n";

        if (
is_dir($root.$dir) && $dh opendir($root.$dir)) {
                while ((
$file readdir($dh)) !== false) {
                    if (
preg_match("/^\\..*\$/i",$file) != 0)
                        continue;
                    echo 
"<tr><td><a href=\"".eregi_replace("\\.ext\$","",$file)."\">".eregi_replace("\\.ext\$","",$file)."</a></td>\n<td>/</td>\n"
                        
."<td>".filetype($root.$dir.$file)."</td>";
                    if (
filetype($root.$dir.$file) !== "dir")
                        echo 
"\n<td>/</td>\n<td>".filesize($root.$dir.$file)." bytes</td>\n";
                        if (
preg_match("/.php\$/i",$file) != 0)
                            echo 
"<td>/</td>\n<td><a href=\"/".$dir.$file."/showsource\">View source</a></td>\n<td>/</td>\n"
                                
."<td><a href=\"/".$dir.$file."/getsource\">Download source</a></td>";
                    echo 
"</tr>\n";
                }
                
closedir($dh);
        }
        echo 
"</table>\n";
    } else
        echo 
"Listing forbidden!!!";

    echo 
"<div class=\"hr\">&nbsp;</div>\n";

    
// Sending to output
    
echo $mtpl->finish();

    
// BBClone counter
    
if (!preg_match("/^misc\\/(temp|ves|secure)\\//",$dir) && !isset($_COOKIE['Leppsville-Block-BBClone-Log'])) {
        
define("_BBC_PAGE_NAME",$text_folder." /".$dir);
        
define("_BBCLONE_DIR",$root.$stats);
        
define("COUNTER",_BBCLONE_DIR."mark_page.php");
        if (
is_readable(COUNTER))
            include_once(
COUNTER);
    }

?>