2018-08-10, 01:38:54
(This post was last modified: 2018-08-10, 01:43:54 by vanfruniken.)
(2018-08-07, 23:42:03)linden Wrote:(2015-03-11, 23:51:02)shawn_a Wrote: nono use foreach much easier to write and read, and faster then counting each iteration ( and your missing quotes )...
PHP Code:$images = explode('||', get_special_field_image('image'));
foreach($images as $image){
echo '<img src="'.$image.'">';
}
and if you need $i for index or something
PHP Code:foreach($images as $key=>$image){
// echo $key; // zero based index
echo $key.'<img src="'.$image.'">';
}
But is there a way to also get the thumbnail for the image somehow?
I would need something like this:
PHP Code:$images = explode('||', get_special_field_image('image'));
foreach($images as $image){
echo '<a href="'.$image.'"><img src="'.$thumbnail.'"></a>';
}
As far as I can tell (GS 3.3.13), the thumbnails that I have in /GS/data/uploads/path-to-imageFile/$imageFileName are automatically generated, and they can be found in two sizes:
as /GS/data/thumbs/path-to-imageFile/{'thumbnail.'$imageFileName} (200x200)
and as /GS/data/thumbs/path-to-imageFile/{'thumbsm.'$imageFileName} (48x48)
Up to you to generate the proper $thumbnail string for each $image. Probably better to store only 'path-to-imageFile/$imageFileName' in your special fields.