Hi Richard,
There are a couple out there... I created one for
myself (V1.un) that does something similar... It
relies on a couple of support files for mime-types and
icons. Here's the code... if you like the idea, I can
zip up the icons and extension-to-mime folders and
send it to ya. My website (www.jwfarrell.com) is
supposed to be online later this afternoon (after a
week of promises from my ISP), so you'll be able to
look at the code in action.
B
listtree.php
?php
$MetaTitle = Locally-Mirrored Documentation;
$MetaDescription =Answerbase for Multivalue
Programmers;
$MetaKeywords = UNIVERSE, UNIDATA, APACHE PERL, HTML
REFERENCE, CSS, CASCADING STYLE SHEET, REFERENCE,
SEARCH;
include( style/htmlhead.php );
$SuppressSearch = false;
$OnLoad = ;
include(style/bodytemplate_top.php);
// user config
$Gaol = $DocRoot/help;// set a ceiling so people
don't prowl the system
$GaolURL = /help; // ceiling in URLspace
$IconsFolder = $DocRoot/graphics/icons; // directory
for icons
$MimeTypeFolder = $DocRoot/ext2mime; //
extension-to-icon map
$Subdirectories = array();
$SimpleFiles = array();
$TitleStart = ThEtItLe;
$TitleReplacement = MV_FM . $TitleStart . MV_FM;
$TitleEnd = MV_FM;
//echo Method is $Methodbr\n;
?
h2Browse the Documentation Tree/h2
form action=/listtree.php method=POST
fieldset style=width: 500px; text-align: left;
text-indent: 0em;
table border=0 cellpadding=0 cellspacing=0
width=100%
col style=width: 20px;
col style=width: 20px;
col
captionFolder contents/caption
?php
unset( $DocDirectory );
if ( $Method == POST ) {
$TargetFolder = $Folder;
if ( substr( $TargetFolder, -2 ) != '..' ) {
if ( $TargetFolder == $GaolURL ) { $TargetFolder =
; }
//echo Setting folders from $TargetFolderbr\n;
$DocArray = explode( '/', $TargetFolder );
$DocDirectoryArray = array_slice( $DocArray, 1 );
$DocDirectory = implode( '/', $DocDirectoryArray );
$CurrentFolder = $TargetFolder;
//echo Doc Directory is $DocDirectorybr\n;
$FullPath = explode( '/', $DocDirectory );
$PreviousDirectoryArray = array_slice( $FullPath, 0,
count( $FullPath ) - 2 );
$PreviousDirectory = implode( '/',
$PreviousDirectoryArray );
$FullURL = explode( '/', $CurrentFolder );
$PreviousFolderArray = array_slice( $FullURL, 0,
count( $FullURL ) - 1 );
$PreviousFolder = implode( '/', $PreviousFolderArray
);
}
}
// init tree - disallow attempts to go above gaol
if ( ( !isset( $DocDirectory ) ) | ( strlen(
$DocDirectory ) strlen( $GaolURL ) ) ) {
$DocDirectory = $Gaol;
$DocDirectoryArray = array( $DocDirectory );
$CurrentFolder = $GaolURL;
$PreviousFolderArray = array( );
$PreviousFolder = ;
}
if ( ( $Docs = opendir( $DocDirectory ) ) === false )
{ die( $DocDirectory doesn't exist! ); }
while ( false !== ( $Subdir = readdir( $Docs ) ) ) {
if ( ( substr( $Subdir, 0, 1 ) != . ) ) {
if ( is_dir( $DocDirectory/$Subdir ) ) {
array_push( $Subdirectories, $Subdir );
} else {
array_push( $SimpleFiles, $Subdir );
}
}
}
sort( $Subdirectories );
sort( $SimpleFiles );
?
tr
thnbsp;/th
thnbsp;/th
thName/th
thSize/th
/tr
?php
$Level = 0; // how many t-bars in?
echo tr\n;
echo td align=\left\ valign=\top\
style=\line-height: 125%;\a href=\/help\img
style=\border: none;background: transparent;
line-height: 110%;\ height=\16\
src=\/graphics/icons/folder_home.png\/td\n;
echo tdnbsp;/td\n;
echo tdDocumentation Home Page/td\n;
echo /tr\n;
echo trtdnbsp;/td/td\n;
if ( $DocDirectory != $Gaol ) {
echo tr\n;
echo td align=\left\ valign=\top\input
name=\Folder\ style=\border: none;background:
transparent;\ type=\image\ height=\16\ value=\\
src=\/graphics/icons/mark_top.gif\/td\n;
echo tdnbsp;/td\n;
echo tdTop of the Tree/td\n;
echo /tr\n;
echo trtdnbsp;/td/tr\n;
echo tr\n;
echo td align=\left\ valign=\top\input
name=\Folder\ style=\border: none;background:
transparent;\ type=\image\ height=\16\
value=\$PreviousFolder\
src=\/graphics/icons/back.gif\/td\n;
echo tdnbsp;/td\n;
echo tdUp one level to $PreviousFolder/td\n;
echo /tr\n;
echo trtdnbsp;/td/tr\n;
}
?
tr
td align=left valign=topimg
src=/graphics/icons/folder_open.png/td
tdnbsp;/td
td align=left?php echo $CurrentFolder; ?/td
/tr
?php
$LastFolder = $Subdirectories[ count( $Subdirectories
) - 1 ];
$LastFile = $SimpleFiles[ count( $SimpleFiles ) - 1 ];
foreach ( $Subdirectories as $Subdir ) {
echo tr\n;
if ( ( $Subdir == $LastFolder ) ( $LastFile