If you don't want toenable apache's indexer for whatever reason, you can add this script, though it's in PHP:
(more revisions, etc. here:
http://www.furry.ca/cgi-bin/furryca/...ct=ST;f=9;t=50 )
PHP Code:
<?php
/* Karma's Funkii Index Script CopyLeft 2003 The Entity Known As Karma Foxx
(karma@yiffy.tk - [url]www.yiffy.tk[/url])*/
// Opening Static HTML
print("
<html>\n<head>\n<title>Index</title>\n<style>
body
{
background-color: #FFFFFF;
font-size: 10pt;
font-family: Arial, Helvetica;
color: #000000;
}
a:link
{
color: #666666;
text-decoration: none;
}
a:visited
{
color: #666666;
text-decoration: none;
}
a:active
{
color: #666666;
text-decoration: none;
}
a:hover
{
color: #999999;
text-decoration: none;
}
img
{
border: 0px;
}
</style>\n</head>\n<body>\n<center>
<font size=\"+1\">\n<b>Index of ".exec("pwd")." | <a href=\"../\">Parent Directory</b></a>\n</font>
<table width=\"98%\" cellpadding=\"0\" cellspacing=\"2\" marginwidth=\"0\" marginheight=\"0\">
");
// Define functions
function makeThumb($image) // Makes a thumbnail of the file in question
{
if(! file_exists(".thumbs/".$image))
{
if(! is_dir(".thumbs"))
{
mkdir(".thumbs");
}
exec("convert -size 80x60 $image -resize 80x60 .thumbs/$image");
}
}
function tests($file) // Perform tests on the file, then output an array
{
if(is_file($file))
{
$image_types = array("\.png", "\.jpg", "\.jpeg", "\.jfif", "\.gif", "\.bmp", "\.xbmp", "\.tiff");
$document_types = array("\.txt", "\.doc", "\.rtf", "\.pdf", "\.ps", "\.eps", "\.sgml", "\.DocBook");
$web_types = array("\.htm", "\.html", "\.shtml", "\.php", "\.cgi", "\.pl", "\.js", "\.vb", "\.asp");
$output[type] = "File";
foreach($image_types as $ext)
{
$results = ereg($ext, $file);
if(gettype($results) == integer)
{
$output[type] = "Image";
}
}
foreach($document_types as $ext)
{
$results = ereg($ext, $file);
if(gettype($results) == integer)
{
$output[type] = "Document";
}
}
foreach($web_types as $ext)
{
$results = ereg($ext, $file);
if(gettype($results) == integer)
{
$output[type] = "Web";
}
}
}
elseif(is_dir($file))
{
$output[type] = "Directory";
}
$output[access] = date("D d M Y g : i A", fileatime($file));
$output[mod] = date("D d M Y g : i A", filemtime($file));
$output[changed] = date("D d M Y g : i A", filectime($file));
$output[name] = $file;
$temp_size = filesize($file);
// Format the file size
if($temp_size < 1024)
{
$output[size] = $temp_size;
$output[sizetype] = "B";
}
elseif($temp_size < 1048576)
{
$output[size] = round($temp_size /= 1024);
$output[sizetype] = "KB";
}
else
{
$output[size] = round($temp_size /= 1048576);
$output[sizetype] = "MB";
}
// Check permissions
if(is_readable($file))
{
$permissions = "r";
}
else
{
$permissions = "-";
}
if(is_writable($file))
{
$permissions .= "w";
}
else
{
$permissions .= "-";
}
if(is_executable($file))
{
$permissions .= "x";
}
else
{
$permissions .= "-";
}
$output[permissions] = $permissions;
return $output;
}
function showItem($file)
{
// Set the icon directory
$icons = "file:/var/www/icons";
print("<tr>\n<td bgcolor=\"#E6E6E6\" onMouseOver=\"this.bgColor='#F6F6F6'\" onMouseOut=\"this.bgColor='#E6E6E6'\"><table border=\"0\" width=\"100%\" cellpadding=\"2\" marginwidth=\"0\" marginheight=\"0\" cellspacing=\"0\">\n<tr>\n<td width=\"80\" height=\"60\" valign=\"middle\" align=\"center\">");
if($file[type] == "Image")
{
makeThumb($file[name]);
print("
<a href=\"$file[name]\"><img src=\".thumbs/$file[name]\"></a>
</td>
<td height=\"60\" valign=\"top\" width=\"50%\">
<b>Image Name: </b><a href=\"$file[name]\">$file[name]</a><br>
");
}
elseif($file[type] == "Web")
{
print("
<a href=\"$file[name]\"><img src=\"$icons/web.png\"></a>
</td>
<td height=\"60\" valign=\"top\" width=\"50%\">
<b>Document Name: </b><a href=\"$file[name]\">$file[name]</a><br>
");
}
else
{
print("
<a href=\"$file[name]\"><img src=\"$icons/$file[type].png\"></a>
</td>
<td height=\"60\" valign=\"top\" width=\"50%\">
<b>$file[type] Name: </b><a href=\"$file[name]\">$file[name]</a><br>
");
}
print("
<b>Size: </b>$file[size] $file[sizetype]<br>
<b>Permissions: </b>$file[permissions]<br>
</td>
<td height=\"60\" valign=\"top\" width=\"50%\">
<b>Uploaded: </b>$file[changed]<br>
<b>Modified: </b>$file[mod]<br>
<b>Accessed: </b>$file[access]<br>
</td>
</tr>
</table>\n</td>\n</tr>
");
}
// Feed directory contents into an array
$dh = opendir(".");
while(gettype($entries[] = readdir($dh)) != boolean)
{
$entries[] = readdir($dh);
}
closedir($dh);
sort($entries);
foreach($entries as $file)
{
// Exclude this document and the parent dirs from the list
if($file == "index.php" or $file == "" or $file == "." or $file == ".." or $file == ".thumbs")
{
continue;
}
showItem(tests($file));
}
// Ending Static HTML
print("</table>\n<font size=\"-1\">
This page generated on ".date("D d M Y g : i A")." by Karma's Funkii Index Script<br>
<a href=\"mailto:karma@yiffy.tk\">Contact</a> Karma - <a href=\"http://www.yiffy.tk\">[url]www.yiffy.tk[/url]</a>
</font>\n</center>\n</body>\n</html>");
?>
A demonstation of this script can be found at
http://karma.luniac.com/misc .