Post by entangled80 » Tue Sep 20, 2016 12:19 am

Hello

Is there a way (without purchasing an extension unless necessary) that I can insert the below simple PHP script into a page?

I have a module for custom HTML, but it strips any script. I need to automatically show a gallery of images located in certain folders which I can't do with HTML.

Code: Select all

<?php
 
// directory
$directory = "folder/uploaded/images/*/*/";

// file type
$images = glob("" . $directory . "*.svg");
 
foreach ($images as $image) {
	echo '<img src="' . $image . '" width="50" /> ';
} 
 
?>
Thank you

Newbie

Posts

Joined
Sat Sep 17, 2016 7:26 pm

Post by Avvici » Tue Sep 20, 2016 1:13 am

I'd recommend thoroughly looking at the gallery extensions before going that route: http://www.opencart.com/index.php?route ... ch=gallery

User avatar
Expert Member

Posts

Joined
Tue Apr 05, 2011 12:09 pm
Location - Asheville, NC

Post by entangled80 » Tue Sep 20, 2016 3:36 pm

Thanks Avvici

I agree, the only issue I have is that the images are all stored in different subfolders, I haven't found a gallery extension that will look in all subfolders and display the images found in them. Most galleries I've found need you to point to a specific location or upload the images specifically for it.

I'll take another look though,

Al

Newbie

Posts

Joined
Sat Sep 17, 2016 7:26 pm
Who is online

Users browsing this forum: No registered users and 163 guests