Display order of thumbs in Bakery

svsanchez

Hello everyone, I was finally able to solve this problem, there are a few errors with the code as it was posted, because the $ sign is separated from the words to the right which I assume are variables, and also the two // are separated and this is what was causing error messages. Also, the code has to be inserted before the line 'continue;' which should be line 170. If it is placed after the 'continue;' line the thumbnails won't be ordered.

Thanks a lot to Jacobi22 for the code and help in solving this issue, if someone else wants to order their [THUMBS] in bakery here is how your code should look, notice it's the same code but with the $ and / signs together:

asort ($thumb_arr);
asort ($image_arr);
// Make strings for use in the item templates
$thumbs = implode ("\ n", $thumb_arr);
$images = implode ("\ n", $image_arr);


Kind regards!

Gast

#4
Quote from: svsanchez on June 27, 2014, 12:37:20 AM


Where should I include this codes?

asort ($ thumb_arr);
asort ($ image_arr);


And this one?

/ / Make strings for use in the item templates
       $ thumbs = implode ("\ n", $ thumb_arr);
       $ images = implode ("\ n", $ image_arr);




exactly in this order


asort ($ thumb_arr);
asort ($ image_arr);
/ / Make strings for use in the item templates
$ thumbs = implode ("\ n", $ thumb_arr);
$ images = implode ("\ n", $ image_arr);



svsanchez

Hello Jacobi22, thank you very much for your reply, that seems like a promising solution. I used Google translate to try and decipher what to do, but the translation wasn't clear enough and everything I tried gave me error messages. I understand I have to insert some code somewhere, but it didn't matter where I inserted it I only got errors. This is what I have in view_item near line 170:

// Check if a main thumb/image is set
if ($image_file == $item['main_image']) {

$thumb = $prepend.$thumb_url.$thumb_file.$img_append;
$image = $prepend.$img_url.$image_file.$img_append;
continue;
}
// Make array
$thumb_arr[] = $prepend.$thumb_url.$thumb_file.$thumb_append;
$image_arr[] = $prepend.$img_url.$image_file.$img_append;
}


Where should I include this codes?

asort ($ thumb_arr);
asort ($ image_arr);


And this one?

/ / Make strings for use in the item templates
        $ thumbs = implode ("\ n", $ thumb_arr);
        $ images = implode ("\ n", $ image_arr);


svsanchez

Hello everyone! I have a difficult customer who wants to show the thumbs in bakery in a given order. We thought it would be as easy as saving the images in "reverse" order, meaning that the first image that we save would be the last image to be shown in the [THUMBS] strip. However, I soon noticed the order would change to a random order when we added new images to a product.

I then tried renaming the pictures 01.jpg, 02.jpg etc... in the media/bakery/itemN folder and all I got was brokien images in the test product. Uploading them with the names 01.jpg, 02.jpg etc didn't work either.

How do I control the order of appearance of [THUMBS] ?