Location: PHPKode > projects > Peardrop CMS > peardrop/inc/nav.inc.php
<?php
////////////////////////////////////////////////////////////////////////
//
//      Use this file if you decide to make your own HTML Template,
//        and add it to the 'nav' area of your HTML, format uses
//           standard CSS style <ul> <li> method of listing
//
////////////////////////////////////////////////////////////////////////
?>
<ul>
<li><a href=index.php?p=home>Home</a></li> <!--Home is always first -->
<?php
// open this directory 
$myDirectory = opendir("content/");
//get each entry
while($entryName = readdir($myDirectory)) {
	$dirArray[] = $entryName;
}
//close directory
closedir($myDirectory);
//count elements in array
$indexCount	= count($dirArray);
// sort 'em
sort($dirArray);
$dir = "index.php?p=";
// print 'em
// loop through the array of files and print them all
for($index=0; $index < $indexCount; $index++) {
        if (substr("$dirArray[$index]", 0, 1) != "."){ // don't list hidden files
		if ($dirArray[$index] != "home"){ // don't list Home
		print("<li><a href=\"$dir$dirArray[$index]\">$dirArray[$index]</a></li>\n");
	}
	}
}
?>
</ul>
Return current item: Peardrop CMS