File listings

apps

#1

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

http://themezz.com/files/apps/


http://theMezz.com


#2

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.

http://groups.google.com/group/adsense-help?lnk=li

http://benconley.net
http://teamshocker.com


#3

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'] = ""; } } } } ?>
DIRECTORIES:
FILES:
    <?php array_multisort($aFileArr, SORT_ASC); foreach ($aFileArr as $filePtr) { echo "
  • ".$filePtr['filename'].""; if(strlen($filePtr['filesize'])) { echo "".$filePtr['filesize'].""; } echo "
  • \n"; } ?>
[/code][url=http://benconley.net]http://benconley.net[/url] [url=http://teamshocker.com]http://teamshocker.com[/url]

#4

i dunno how


http://theMezz.com


#5

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

http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_troubleshooting&Number=56541&page=&view=&sb=&o=&vc=1
http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_programming&Number=48977&page=&view=&sb=&o=&vc=1
http://discussion.dreamhost.com/showflat.pl?Cat=&Board=forum_troubleshooting&Number=35874&page=&view=&sb=&o=&vc=1

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

http://httpd.apache.org/docs/1.3/mod/mod_autoindex.html
http://httpd.apache.org/docs/2.0/mod/mod_autoindex.html

Mark


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


#6

Thank you very much !!!


http://theMezz.com