File listings

anyway to have a fancy file listing? or at least a way to show the full file names…

right now only the first xx number of characters of each filenames are actually displayed

see what I mean here

You’re kind of a turd for linking us to a place in order to boost your AdSense impressions.

By the way, that page is in direct violation of at least two items in the AdSense terms of service. You’ll probably want to remove the Google Ads unless you’re looking to get banned by them.

They’re strict dude. Have you ever looked at the AdSense newsgroups? You’ll see what I mean if you do.

Here’s a php page I wrote a while back. You can put it into any folder, and name it whatever. When you go there it will generate a dynamic directory/file listing, along with url-safe links. Just add a stylesheet to customize the look. It’s configured to display gif and jpg file extensions. You can add/remove any sort of file types at the lines that look like this:

substr($filename, strrpos($filename, "."), strrpos($filename, ".")+3) == ".jpg"[code]

Files <?php $pathStr = $_SERVER["DOCUMENT_ROOT"].$_SERVER["PHP_SELF"]; $dir = substr($pathStr, 0, strrpos($pathStr, "/")+1); //HTTP_HOST $dh = opendir($dir); $aDirArr = array(); $aFileArr = array(); while (false !== ($filename = readdir($dh))) { $pos = strrpos($filename, "."); if ( ( is_dir($filename) && $filename != ".") || substr($filename, strrpos($filename, "."), strrpos($filename, ".")+3) == ".gif" || substr($filename, strrpos($filename, "."), strrpos($filename, ".")+3) == ".jpg" ) { $nFileKBsize = filesize($filename); settype($nFileKBsize, "integer"); $nFileKBsize = $nFileKBsize/1024; settype($nFileKBsize, "integer"); if(is_dir($filename)) { $aDirArr[$filename] = array(); $aDirArr[$filename]['filename'] = $filename; $aDirArr[$filename][] = ""; } else { $aFileArr[$filename] = array(); $aFileArr[$filename]['filename'] = $filename; if(is_file($filename)) { $aFileArr[$filename]['filesize'] = number_format($nFileKBsize)." KB"; } else { $aFileArr[$filename]['filesize'] = ""; } } } } ?>
    <?php array_multisort($aFileArr, SORT_ASC); foreach ($aFileArr as $filePtr) { echo "
  • ".$filePtr['filename'].""; if(strlen($filePtr['filesize'])) { echo "".$filePtr['filesize'].""; } echo "
  • \n"; } ?>
[/code][url=][/url] [url=][/url]

i dunno how

There have been a few forums threads on this subject over the last few months, you might find the information you need in them;

Reading the official Apache docs on the subject may also help.


Save [color=#CC0000]$50[/color] on DreamHost hosting using promo code [color=#CC0000]SAVEMONEY[/color] ( Click for promo code details )

Thank you very much !!!