|
|
Parent Directory
| CGIndex
Brett Lee - Everything Penguin, Inc.
I got tired of looking at the way Apache presents a standard directory listing.
In looking at Apache, I found that it had "Fancy Indexing." That was WORSE! :)
In looking further, I found:
1. Interesting support for CSS in LIGHTTPD via "mod_dirlisting"
2. Seemingly convoluted ways using JavaScript and CSS
3. A plethera of PHP scripts (all seemed to require traversal via the root)
So I set out to write my own, and discovered one little thing that made
the whole exercise trivial, namely, an Apache parameter I've seen 1000
time before : DirectoryIndex !!!
Typically, DirectoryIndex looks like this:
DirectoryIndex index.html index.shtml index.htm...
Something unknown to me until I saw it was, that it could also look like this:
DirectoryIndex index.html index.shtml index.htm /cgi-bin/index.cgi
Which means, all you have to do is write your CGI script, and any directory
that doesn't have the appropriate file will get your script instead of the
automatic Apache Directory Index. DUH! Of course !!! :)
So in making the script, I wanted to create a custom header and footer. These
are both sourced and printed by the script.
And like many folks, I have lots of digital pictures of the family vacations,
so I thought it would be nice to have a thumbnail next to each in my custom
directory listing.
So, after CGIndex was written, I scripted up a quick solution using
ImageMagick's convert program and integrated it into CGIndex.
The program to generate thumbnails recursivly parses a directory structure
(which in my case contains my photos) and creates thumbnail directories
in every directory. After creating the thumbnail directory, it finds every
JPG in the directory structure and creates thumbnails of each in the
thumbnail directories.
Integrating this into CGIndex, that script simply checks each JPG file for
an accompanying thumbnail, and if found displays it.
-Brett
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
In an effort to provide a service of value to the open source community, I've put together this website that containing many of my notes and references.
This website is not authoritative and it is certainly not without errors; it is a work in progress.
In addition to my contributions you will also find the work of others. Where the work is not mine, I have tried to indicate that, and to reference the source of the work: by citing the original author, retaining the authors' name and license wherever present, or by placing the work in a suitably named URL containg /external/ in the path. If you find any work here that should not be publically available, please send me a note and it will be removed.
As for my contributions, you are free to use any of *MY* notes or code from this website unless specifically instructed otherwise.
Brett Lee, Ph.D., President & CEO
Everything Penguin, Inc.
|
|
|