Return images from a folder for jQuery Cycle

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
cb2004
Power Poster
Power Poster
Posts: 317
Joined: Wed Jul 04, 2007 3:39 pm

Return images from a folder for jQuery Cycle

Post by cb2004 »

I thought to lighten the load of a site and not install another module I would write a quick UDT to return all the jpegs from a folder and spit them out to so I could use jQuery Cycle on them.

UDT called slideshow

Code: Select all

$files = glob('uploads/images/front-slideshow/*.*');

foreach($files as $file) {
	if(!preg_match('/thumb_/',$file) && preg_match('/.jpg/i',$file)) {
		echo '<img src="' . $file . '" />';
	}
}
Template with an example of CGSmartImage in use

Code: Select all

{cgsi_convert max_width='400'}{slideshow}{/cgsi_convert}
I cant see any problems with this in future versions either.
Post Reply

Return to “The Lounge”