Page 1 of 1

create page with links from an folder

Posted: Fri Mar 05, 2010 10:11 pm
by Guerrero
is available some module that lets you have a page that automatically have links to all the files in an folder?

i.e. suppose I have an folder .....\documents

and I like have a page listing all the files in the folder as:

down  date  filename

where date are the date of the filename, obviously.
down can be an little image with the link

a table format with three columns would be great.

other option can be run each n minutes or hours an job that creates the page or table....

thanks.

Re: create page with links from an folder

Posted: Fri Mar 05, 2010 10:32 pm
by JeremyBASS
use the php function gob ... something like

{assign var=Files value="documents/*"|glob}
{foreach from=$Files item='File'}
{$File}
{/foreach}

look to the php man for more info

cheers
Jeremy

Re: create page with links from an folder

Posted: Fri Mar 05, 2010 10:54 pm
by jmcgin51
IIRC there is a filelink plugin for this.  Check the Forge or search the Forum; this has been discussed before.

Re: create page with links from an folder

Posted: Fri Mar 05, 2010 11:55 pm
by Guerrero
Hi Jeremy,
thanks very much.

unfortunately I don't have the knowledge nor the time for refine your idea, that works but
- don't create links
- shows the folder for each file, I want only the file
- don't show date of each file
- shows a blank line between each file

also unfortunately I've some troubles with the embebed editor in cmsms 1.6.6, thus don't show the toolbar, see image.
http://farm3.static.flickr.com/2679/4409169221_bc04438e6c_o.png

Re: create page with links from an folder

Posted: Sat Mar 06, 2010 12:06 am
by Guerrero
jmcgin51 wrote: IIRC there is a filelink plugin for this.  Check the Forge or search the Forum; this has been discussed before.
in Extensions - Module manager there is nothing like these.

Re: create page with links from an folder

Posted: Sat Mar 06, 2010 12:44 am
by JeremyBASS
Guerrero wrote: also unfortunately I've some troubles with the embebed editor in cmsms 1.6.6, thus don't show the toolbar, see image.
http://farm3.static.flickr.com/2679/4409169221_bc04438e6c_o.png
first.. try to addjust the settings for the tinyMEC... look for static confing in the advanced tab... Next
Guerrero wrote: unfortunately I don't have the knowledge nor the time for refine your idea, that works but
- don't create links
- shows the folder for each file, I want only the file
- don't show date of each file
- shows a blank line between each file
you need to think outside the box... to filter out the folders... use /*.* instead of /* ... to create the links like so wrap it in an ... just add the line in the foreach... foreach... 


{assign var=Files value="documents/*.*"|glob}
{foreach from=$Files item='File'}
{$File} - date {$File|filemtime|cms_date_format} |
{/foreach}
here it is in action



Now that is just the rough.. you can do this to all the folder you wish...  you'll need to spent the time and learn some of this if you’re planning on doing more... sorry I had to do the same... but this should be more than enough to get you started… also Google smarty and read up on that.. a days worth of study may same some hair from being pulled later  my friend.  Cheers -Jeremy

Re: create page with links from an folder

Posted: Sat Mar 06, 2010 2:47 am
by jmcgin51
Guerrero wrote:
jmcgin51 wrote: IIRC there is a filelink plugin for this.  Check the Forge or search the Forum; this has been discussed before.
in Extensions - Module manager there is nothing like these.
That's why I said check the Forge or search the Forum.

http://dev.cmsmadesimple.org (search for "download")

or search the Forum for "list files"

Re: create page with links from an folder

Posted: Sat Mar 06, 2010 3:30 am
by Guerrero
{assign var=Files value="documents/*.*"|glob}
{foreach from=$Files item='File'}
{$File} - date {$File|filemtime|cms_date_format} |
{/foreach}
Jeremy,
Thanks very much, it works .

Re: create page with links from an folder

Posted: Sat Mar 06, 2010 3:38 am
by Guerrero
IIRC there is a filelink plugin for this.  Check the Forge or search the Forum; this has been discussed before.

That's why I said check the Forge or search the Forum.

http://dev.cmsmadesimple.org (search for "download")

or search the Forum for "list files"
Oh, I've found it:
http://dev.cmsmadesimple.org/projects/list_downloads

Thanks very much.