Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

directory listing script

  • 11-02-2010 11:11PM
    #1
    Registered Users, Registered Users 2 Posts: 2,985 ✭✭✭


    Im looking for a directory listing script for a project im working on, does anyone recommend any, will look at both free and paid ones.
    Have been looking at eSyndiCat, looks good, any equivalent open source solutions?


Comments

  • Closed Accounts Posts: 1,619 ✭✭✭Bob_Harris


    I don't think eSyndiCat is a directory listing scirpt.

    This should get you started. Pass 'true' if you want it to list the contents of sub-folders too.


    [php]
    dirList('.', false);

    function dirList($path, $recursive)
    {
    $ignore = array('.', '..'); //files||dirs to ignore
    $dh = @opendir($path);
    while(($file = readdir($dh)) !== false)
    {
    if(!in_array($file, $ignore))
    {
    if(is_dir("$path/$file") && is_readable("$path/$file"))
    {
    echo "<strong>".substr("$path/$file",2)."</strong><br />";
    if($recursive)
    dirList("$path/$file");
    }
    else
    {
    echo substr("$path/$file",2). "<br />";
    }
    }
    }
    closedir($dh);
    }
    [/php]


  • Registered Users, Registered Users 2 Posts: 2,985 ✭✭✭skelliser


    sorry i meant a business directory software/script. Also to be used for listing articles or classifieds etc.
    Not for directores/folders on a pc, cheers for the reply tho


Advertisement