Location: PHPKode > projects > Peardrop CMS > peardrop/inc/pages.php
<?php
// public pages
	$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);


// Hidden Pages
	$myDirectoryh = opendir("../hidden/");
	//get each entry
	while($entryNameh = readdir($myDirectoryh)) {
		$dirArrayh[] = $entryNameh;
	}
	//close directory
	closedir($myDirectoryh);
	//count elements in array
	$indexCounth	= count($dirArrayh);
	// sort 'em
	sort($dirArrayh);
	
		echo ("<h4>Listed Pages</h4>");
		// open this directory for public pages
		// print 'em
		print("<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" >\n<tbody>\n");
		// 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
				print("<tr><td>$dirArray[$index] </td>\n<td> <a href=\"index.php?p=$dirArray[$index]\" target=\"_blank\">[Link/View]</a> <a href=\"admin.php?do=edit&t=content&f=$dirArray[$index]\">[Edit]</a> <a href=\"admin.php?a=delete&f=$dirArray[$index]&t=content\">[Delete]</a></td>\n</tr>");
			}
		}
		print("</tbody>\n</table>");

		//next Hidden Pages

		echo ("<br><h4>Hidden Pages</h4>");
		// print 'em
		print("<table border=\"0\" cellpadding=\"1\" cellspacing=\"1\" >\n<tbody>\n");
		// loop through the array of files and print them all
		for($indexh=0; $indexh < $indexCounth; $indexh++) {
			if (substr("$dirArrayh[$indexh]", 0, 1) != "."){ // don't list hidden files
				print("<tr><td>$dirArrayh[$indexh] </td>\n<td>  <a href=\"index.php?p=$dirArrayh[$indexh]&t=hidden\" target=\"_blank\">[Link/View]</a> <a href=\"admin.php?do=edit&t=hidden&f=$dirArrayh[$indexh]\">[Edit]</a> <a href=\"admin.php?a=delete&f=$dirArrayh[$indexh]&t=hidden\">[Delete]</a></td>\n</tr>");
			}
		}
		print("</tbody>\n</table>");

		?>
Return current item: Peardrop CMS