SWEET! haha after all that all that had to be changed was that! perfect thanks mate. Im surprised that this isn't controllable from the admin!
SWEET! haha after all that all that had to be changed was that! perfect thanks mate. Im surprised that this isn't controllable from the admin!
Phil Rogers
A problem shared is a problem solved.
The only issue with the code change is if there are no additional images, it will put 3 'Image Not found' images.
hmm yeah i do have some that have none. so thats a problem.
How can I test if there is no images in the array?
tied this but doesnt work..
if ($num_images < 1) {
$num_images = sizeof($images_array);
} else {
// Build output based on images found
$num_images = 3;
}
Phil Rogers
A problem shared is a problem solved.
haha was having a brian fart.
this is the fix
if ($num_images < 3) {
$num_images = sizeof($images_array);
} else {
// Build output based on images found
$num_images = 3;
}
Phil Rogers
A problem shared is a problem solved.
no the logic is
if the number of images in the array is less than 3 then do what it normally does, i.e $num_images = sizeof($images_array); other wise if there are 4 or more excecute the mod that you said which instead of building based on the actual number of images, it only buoilds up to 3.
make sense? works a treat anyway :)
Thanks for you help dgent
Phil Rogers
A problem shared is a problem solved.
Ah yes of course I didnt read it properly.
Philip937,
I am happy to hear you found the solutions for this! Can you please show me exactly where you added this code in includes/modules/additional_images.php? Or if you removed anything? Thank you!
cant remeber off the top of my head but I think I just added this code either after where $num_images is defined
so basically what its doing is saying if there is less than 3 images then the amount of images should be default i.e sizeof($image_array)
otherwise lets fool it into thinking that there are only a max of 3..PHP Code:
if ($num_images < 3) {
$num_images = sizeof($images_array);
}
so full code would be:PHP Code:
else {
// Build output based on images found
$num_images = 3;
}
hope this helps, if you get stuck let me know any I will pull more code from my file I modified. what version are you using also, just incase the code has been changed from the version I was playing with!PHP Code:
if ($num_images < 3) {
$num_images = sizeof($images_array);
}else {
// Build output based on images found
$num_images = 3;
}
Phil Rogers
A problem shared is a problem solved.
Bookmarks