WordPress.org

Ready to get started?Download WordPress

Forums

Listing a Directory (20 posts)

  1. th3gh05t
    Member
    Posted 8 years ago #

    Hi,

    I would like to add a page to my wordpress site that basically just lists a directory on my server. (Ex. /wp-content/data/)

    Is there some PHP or HTML code that will help me do this? Is it possible to have all of the files listed linked to themselves?

    Thanks!

  2. hbalagh
    Member
    Posted 8 years ago #

    im not sure if i understand exactly what you want / need

  3. th3gh05t
    Member
    Posted 8 years ago #

    I have files that are in a directory. And I need some sort of script that will list all of them, and have them linked.

    I have over 200 small files that I don't want to type out and link them.

    Is there some sort of script?

  4. hbalagh
    Member
    Posted 8 years ago #

  5. th3gh05t
    Member
    Posted 8 years ago #

    Exactly. Something like that. But more like this:
    http://brokedownmelodies.com/BrushfireFairytales/

    Can you help?

  6. hbalagh
    Member
    Posted 8 years ago #

    well i took another script and just modded it a little to fit inside wordpres

  7. hbalagh
    Member
    Posted 8 years ago #

    ill zip up the couple files i have and upload them if you want to work with what i have and just edit it to your needs

  8. hbalagh
    Member
    Posted 8 years ago #

    ok here it is, i hope that i made the instructions simple enough :)

    http://www.heathersblog.com/directory.zip

  9. th3gh05t
    Member
    Posted 8 years ago #

    wow! thank you!

  10. hbalagh
    Member
    Posted 8 years ago #

    did you use it?

  11. PeterAlexander
    Member
    Posted 8 years ago #

    I have used it and it is almost perfect.

    I wonder, could the display of the directory be displayed in the blog pages, rather than on its own blank page?

    Is it possible to make the listing handle directories? Presently, if directory listing is switched off, then an error occurs when trying to enter a directory, and if it is not, then the user clicks on a directory and is sent to the standard webpage directory listing, which is fugly.

    Anyone know how to get round these?

  12. jwurster
    Member
    Posted 8 years ago #

    There was recently another solution to this. It is called indexer.php. My memory fails me as to where I got it. However, if you do a search here, you should find the link. I use it on my site for a Downloads page. Check it out and see if that is what you need - http://www.jwurster.us/wordpress/.

  13. PeterAlexander
    Member
    Posted 8 years ago #

    Thanks for the reply. Indexer.php is actually contained in the download above, and I have it working. However, issues are twofold (bearing in mind I am an all-but-complete newbie at this).

    1) If I create a page (rather than post), then that page is not displayed as part of the blog, but it its own page. I'd like the listing to be displayed like the blog posts.

    2) The listing is not recursive (is this the right word?). It's fine for listing 100 files, but it doesn't work when the directory in question has sub-directories.

    I want to use the webpage created to deliver company news and information, and this involves offering a large number of files, which need to be sorted by directory (there are 6 languages for each file, for example).

    Any ideas how I can get this working? I have my pages designed and ready to go. Displaying the files as they are organised in a directory as part of the blog pages is the last thing I need to do, having got the rest sorted very quickly and easily.

  14. jwurster
    Member
    Posted 8 years ago #

    I have my Downloads Page as a Page on my blog. Did you use the Page Template "indexer" as your template?

    I also wanted to display the files in sub-folders. I have started looking for a solution, but maybe a quick email to the indexer developer would help.

  15. PeterAlexander
    Member
    Posted 8 years ago #

    I did indeed use that template. The link to the page is certainly part of the blog (under "Pages"), but when clicking on the page link, it clears everything in the browser window and just shows the directories. It does not appear "embedded" as part of the blog like a post does, and that's really what I want.

    Who is the developer? Sounds like hbalagh just tweaked someone else's code.

    Ideally I suppose I need a post that lists the selected directory by using some code, but that's just so far beyone me. :(

  16. jwurster
    Member
    Posted 8 years ago #

    I have searched and found some php script that might help. If only I knew more about php and WP, I might be able to integrate the folder directory script I found with the indexer script. I'm chekcing with a friend to help.

  17. PeterAlexander
    Member
    Posted 8 years ago #

    Thanks. I am alos poking around the net to see what else might be possible. Hopefully, we can crack this. :o)

  18. PeterAlexander
    Member
    Posted 8 years ago #

    No joy. I have found a .asp page that does reasonable directory listings, but no way I know to add it as part of the blog. :o(

  19. th3gh05t
    Member
    Posted 8 years ago #

    Hi,

    I am glad to see that I am not the only one who wanted a feature like this for their website.

    Recently, I incorporated PunBB into my WP site. (http://www.derekrossler.com/forum/), and had to pass the headers and footers in the main.php for the Forum.

    It looks very nice, and I think that we need to do the same with the indexer.php.

    BTW - Where can I download that file?

    Thanks, th3gh05t

  20. jwurster
    Member
    Posted 8 years ago #

    I found a directory listing script from GaMerZ that I am using on my site for my Downloads page. See if that would wor for you.

Topic Closed

This topic has been closed to new replies.

About this Topic