Directory & file listing

Permalink
Hi.

I did some search on the forums, but without any results: Has someone done a block for listing the files from a directory ? I'd like to list the content of a download folder within c5, so that people can download files from there.

I guess that should be quite easy for someone experienced in PHP programming, maybe even an interesting option for the default c5 core blocks ?

If not available yet, any help appreciated how to solve this problem.

sascha
 
sascha replied on at Permalink Reply 1 Attachment
sascha
Noone ? =/

Well, I needed it, so I had to do it myself. It's my first attempt on php and it will be improved later (sort options, better formatting). It shows the content of a folder for download, adding filesize and filemtime.

If someone should be interested, the file has been attached to the message. Simply copy the included folder into your c5's (root)/blocks/ folder, go to dashboard/Add Functionality, install it, use it. File should be self explanatory, but it does not handle errors on wrong URLs yet, so please be careful what you type and see examples on add/edit window.

You can see a live demo at my website (->download->scripts)
andrew replied on at Permalink Reply
andrew
Will check this out...

We have some file/directory helpers in the concrete/helpers directory that may be able to assist with this. They can iterate through the directory and grab all the files, although they don't do much more than that..
sascha replied on at Permalink Reply 1 Attachment
sascha
Now that I learned some php basics writing DirList 1.0, I rewrote the Directory Listing block from the scratch, adding all the functions that I wanted.

The listing has a nice formatting now, featuring a download icon, can be sorted by name, filesize, filemtime, ascending and descending. Title is optional. Size, time and icon are optional and can be hidden via dialog box. No problem to use the block even on the smaller sidebar.

I set up a demo for this block onhttp://www.sisimizi.org/c5demo/... so that you can see how it looks before you try..

Hope you like it :)

@andrew: I use the URL helper on the script to find an icon, but not sure about which others you thought.
Lazza replied on at Permalink Reply
Lazza
What about putting this in the marketplace?
sascha replied on at Permalink Reply
sascha
Sure, why not. I just submitted the block for marketplace, it's probably easier to find for others there. Thanks.
Lazza replied on at Permalink Reply
Lazza
There are some other blocks out there that are quite good but hard to find. Instead you can be sure that the paid addons are easy to find...
An example, this twitter block:http://www.concrete5.org/community/forums/block_requests/another_tw...
sascha replied on at Permalink Reply
sascha
Well, I submitted the block a month ago, but I did not get any message from c5 team since.

It would be nice to know if the block should have been rejected and maybe why, so that I'd be able to improve it then...
Tony replied on at Permalink Reply
Tony
hey sascha, I just had a look for your marketplace submission but I don't see it. did you submit it via the marketplace submission form?

if you resubmit it, can you please make sure that it meets all the package requirements listed here?
http://www.concrete5.org/help/building_with_concrete5/developers/pa...
sascha replied on at Permalink Reply
sascha
Ok. I will change the package to meet all requirements and then try to resubmit again the next days.

PS: I'm quite sure when I submitted the first time (July, 5th) there was no requirements page for blocks linked on the submission page, only the theme submission guidelines. Seems the page - or at least the link - has been added later?

And yes, it was submitted via marketplace submission form without any problems/errors that day.
frz replied on at Permalink Reply
frz
yeah, we've started actually thinking about how our marketplace is going to NOT turn into drupal's mess - so expect those standards to keep maturing.
sascha replied on at Permalink Reply
sascha
Changed the block to meet all package requirements and resubmitted via marketplace submission form.
Hope it worked now ;)
Tony replied on at Permalink Reply
Tony
Sascha's Download Folder block is now available in the concrete5 marketplace:

http://www.concrete5.org/marketplace/addons/download_folder/...
sascha replied on at Permalink Reply
sascha
There's an updated version (2.0 beta) for testing available on the marketplace forumshttp://www.concrete5.org/marketplace/addons/download_folder/support...

It includes some new features, please read latest post from the link.

Comments and bugreports are welcome. Thank you.