Unordered list as multilevel menu
Posted: 09 April 2009 01:35 AM   [ Ignore ]
Newbie
Rank
Total Posts:  2
Joined  2009-04-09

Good day to you all,
        I’m working on a kind of menu script, in fact it read through a directory and return the files and folder, recursively,(PHP)  in a unordered list format (HTML).

        My question is how can style my unordered list to look like a multi level menu ?

     

<?php

function writeFileList($dir{
    $dir 
$dir."/";
    
$folder opendir($dir);
    
    
//ignore hidden files and ., ..
    
echo "<ul>";
    while (
$f readdir($folder)) {
        
if ($f[0] != '.'{
            
if (is_dir($dir.$f) == 1{
                
echo "<li><b>$f</b>";
                
writeFileList($dir.$f);
                echo 
"</li>";
            
else {
                
echo "<li>$f</li>";
            
}
        }
    }
    
echo "</ul>";
}

$base 
'Art/SKYDOME';
writeFileList($base)
?> 


Thnaks !

Profile
 
 
Posted: 14 April 2009 02:07 PM   [ Ignore ]   [ # 1 ]
Newbie
Rank
Total Posts:  14
Joined  2008-02-04

Should be able to use CSS, by either applying an ID or CLASS to the UL or by formatting the UL within whatever “DIV” it’s placed in.

Profile
 
 
Posted: 12 October 2009 10:42 AM   [ Ignore ]   [ # 2 ]
Newbie
Rank
Total Posts:  1
Joined  2009-10-12

^what chris said. Good luck on working with the script. I hope it comes out great and you’d be able to share it with us.

Regards,
Renee
Simulation pret immobilier

Profile
 
 
Posted: 18 August 2010 08:44 AM   [ Ignore ]   [ # 3 ]
Jr. Member
RankRank
Total Posts:  45
Joined  2010-05-17

You can format your order and unorder list separately by using the CSS.

Profile