Description: Use directories to make dynamic Navigation bars.
#This is a very simple dynamic nav bar.
/*This is how to use. make a folder for every section of your site.
*the folder shold be named what the section is called.
* OR add a file .desc in the directory. the contents is what will be displayed
* as the link to that directory.
* copyright 2001 by James Stallings
* you can use this for anything, i don't care.
* PLEASE e-mail me if you like the code. and if you modify it. I'd like
* to know I'm helpful.
/*what directory to use
* '.' is the directory that the page is in.
while (false !== ($file = readdir($handle)))
/*this will grap only directories*/
if (!strcmp(filetype($file), "dir"))
/* this is a list of directory not to list.
* seperate by space, and a space before and after.
* so 'bobsimages' does not exclude 'bob'
* a period at the begining will also exclude a directory.
* this shouldn't be hard to modified to have excluded directories in a file..
if(stristr(" log apache icons cgi-bin .. . ", " ".$file." ") || substr($file, 0, 1) == ".")
/* what should the link text say?*/
$name = ucfirst($file);
$name = implode('', file($file.'/.desc'));
/*pop the link out!*/
echo "<tr><td align=\"center\"><b><a class=\"nav\" href=\"".$file."\">-".$name."-</a></b></td></tr>";