(A)

Polls

I prefer...
 

Who's Online

We have 70 guests online
Home tips and tricks Scripting, PHP and co. Set default image size in gallery2
Set default image size in gallery2

How to set the "full image" as default image if using "resized images" in gallery2?

If multiple image sizes are defined for an album and you want to show the full size image as default, you run into probs, 'cause always the 1st defined custom resized size will be choosen as default.
This behaviour is defined in the following file:

/gallery2/modules/core/classes/GalleryTheme.class


Around Line 1744 you'll find

if (empty($imageViewsIndex)) {
$imageViewsIndex = 0;
}
Change the $imageViewsIndex to the value you need.

The value I need?! What ya mean?Undecided

Navigate to an image in your gallery and choose the size you want to set as default.
For example: [yourwebsite]...?g2_itemId=26&g2_imageViewsIndex=4
In this example the g2_imageViewsIndex is 4, so you need to change the above code to that value.

That would result in
if (empty($imageViewsIndex)) {
$imageViewsIndex = 4;
}

That's it, now another size is default. Have Fun!
 


Partners:
Infinitee Designs 3D Graphics 3D Desktops UK wallpapervault unrealed 3dlinks graphics.com acidicdesigns wpgallery