Jump to:

23491 Posts in 18996 Topics by 2878 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, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 691 Views
  • DesignerX.com.au
    Avatar
    Community Member
    107 Posts

    I need a Small script to scan a folder!! PLEASE HELP ME Link to this post

    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

  • swaiba
    Avatar
    Forum Moderator
    1792 Posts
  • martimiz
    Avatar
    Forum Moderator
    1086 Posts

    Re: I need a Small script to scan a folder!! PLEASE HELP ME Link to this post

    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

    691 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.