21489 Posts in 5783 Topics by 2622 members
General Questions
SilverStripe Forums » General Questions » I need a Small script to scan a folder!! PLEASE HELP ME
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 570 Views |
-
I need a Small script to scan a folder!! PLEASE HELP ME

17 August 2011 at 3:42am
hh..Hi everyone..
I am looking for the following:
A small script to scan a folder for images then give the results as a list, EG:
scan the following folder :
"assets/images "
.. then load the results into a $variable so $variable will result in:
<img alt="" src="/assets/images/image-1.png">
<img alt="" src="/assets/images/image-2.png">
<img alt="" src="/assets/images/image-3.png">
.... & so on
also, has anyone yet create a "working" galley & slider module or widgets.. I wish i had more time, i would be creating one...Thank you Great SS
-
Re: I need a Small script to scan a folder!! PLEASE HELP ME

17 August 2011 at 10:33pm
this will help get you started - http://php.net/manual/en/function.glob.php
-
Re: I need a Small script to scan a folder!! PLEASE HELP ME

17 August 2011 at 11:13pm Last edited: 17 August 2011 11:14pm
Maybe do a query on your Files table. something like:
DataObject::get('File', "ClassName = 'Image' and Filename like '/assets/images/%'");
That will get you the images in the /assets/image/ directory and all its subdirs. It'll work for images that live the Files & images section of the CMS
| 570 Views | ||
|
Page:
1
|
Go to Top |


