tag. %DIR is replaced with the directory path. // for instance: // $titleformat = "antisleep: %DIR"; $titleformat = "three words %DIR"; //======================================================================= // (end of config) //======================================================================= $uri = urldecode($_SERVER['REQUEST_URI']); $uri = preg_replace("/\/ *$/", "", $uri); $uri = preg_replace("/\?.*$/", "", $uri); $titletext = str_replace("%DIR", $uri, $titleformat); // this is hacky, but in almost every situation there's no real harm. // it just might fail if you're doing something funky with directory mappings. $readmetext = ""; $pathtext = ""; $readmefile = $_SERVER["DOCUMENT_ROOT"] . $uri . "/readme.html"; if ($show_readme && file_exists($readmefile)) { $readmetext = "
" . file_get_contents($readmefile) . "
"; } else { // If no readme, show URI. $pathtext = "
$uri
"; } ?> <?=$titletext?>

      Name                    Last modified      Size  Description
Parent Directory - 0101.pdf 15-Sep-2009 03:12 72K 0102.pdf 15-Sep-2009 03:12 69K 1906090103.pdf 15-Sep-2009 03:12 216K 2407090104.pdf 15-Sep-2009 03:12 162K 2904090100.pdf 15-Sep-2009 03:12 36K