[Solved]: Mixed viewing, 3 and 4 columns [Solved]: Mixed viewing, 3 and 4 columns
 

News:

CPG Release 1.6.27
change DB IP storage fields to accommodate IPv6 addresses
remove use of E_STRICT (PHP 8.4 deprecated)
update README to reflect new website
align code with new .com CPG website
correct deprecation in captcha

Main Menu

[Solved]: Mixed viewing, 3 and 4 columns

Started by Peter R, February 25, 2009, 10:03:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Peter R

Hello

I think I want something that can not be easily done.
I the admin, I have set columns to four, so all albums show four columns. I have a best three section, that shows the three best top rated images. For getting this done, I changed:
case 'toprated':
                        display_thumbnails('toprated', $cat, 1, $CONFIG['thumbcols'], max(1, $matches[2]), false);

into:
case 'toprated':
                        display_thumbnails('toprated', $cat, 1, 3, max(1, $matches[2]), false);

This works great, but on the screen it shows three images on the left, and not in the middle. This is because the table row is still divided in four, and not in three. To get the three images in the middle, I have to get rid of the fourth <TD></TD>.

I managed to get three pictures in stead of four, but now I am stuck in solving this problem. Is there an easy way, or can somebody tell me where this is done?

Thanks

Nibbler

Copy theme_display_thumbnails from the sample theme to your theme.php and change


$thumbcols = $CONFIG['thumbcols'];
$cell_width = ceil(100 / $CONFIG['thumbcols']) . '%';


to


$thumbcols = ($aid == 'toprated') ? 3 : $CONFIG['thumbcols'];
$cell_width = ceil(100 / $thumbcols) . '%';


See if that works.

Peter R

Yes, that did the trick.
Ik looks really good.

Thanks a lot!