PDA

View Full Version : Even number of thumbs


zac
03-02-2008, 05:49 AM
Hi I have a set of thumbs running vertical to the main image. I set them within a div that is wide enough to force them to run as two rows parallel. This all works well, however in the thumbs admin it ignores my request for an even number and forces it to an odd set (ie: if I put show 6 thumbs then it shows 7, 4 then 5, etc.. ) I did notice this recommendation in the admin area:

Make this an odd number for best results, ie 7 or 9, not 6 or 8.

But I was wondering if anyone knows of a way to force it to show an even number?

austriaka
03-02-2008, 08:50 AM
You can find the explanation here:
http://www.pixelpost.org/forum/showpost.php?p=53887&postcount=11

the <THUMBNAIL_ROW> tag contains a list of thumbnails before and after the actual image AND includes the actual image as well.
This is the reason why there is always an odd number:
Using 11 you are receiving 5 previous and 5 next images in a row, the actual one between them: 5+1+5 = 11.
Using 10, the script does not know if you want 4 previous and 6 next or vice versa, so it simply takes 5 previous and 5 next, putting the actual image between: 5+5 = 10 +1 = 11

The calculation of next and previous images is quite complicated, so it is not recommended to hack the function itself. But if you really rely on 10 images, you can easily remove the line of code which places the actual image between previous and next row (in index.php), showing only before and after thumbs which counts up to 10 then :-)

zac
03-02-2008, 10:30 AM
Ok thanks for the reply. Can you please point me towards this:

the line of code which places the actual image between previous and next row (in index.php)

zac
03-02-2008, 08:38 PM
I tried messing around with this:

$thumbnail_row = "$behind_thumbs<a href='$showprefix$image_id'><img src='".ltrim($cfgrow['thumbnailpath'], "./")."thumb_".$image_name."' alt='$image_title' title='$image_title' class='current-thumbnail' width='$local_width' height='$local_height' /></a>$ahead_thumbs";

making it like this:

$thumbnail_row = "$behind_thumbs<a href='$showprefix$image_id'></a>$ahead_thumbs";

but no go. Thanks for any help with this.


*SOLVED*

Ok.. that was the right thing to do.. just the wrong file... I forgot that I was running GEos's addon so had to change it in the addons/geos_show_category.php

austriaka
03-03-2008, 08:35 AM
you can skip that part too:
<a href='$showprefix$image_id'></a>

zac
03-03-2008, 08:02 PM
ok thanks :)