clickable random thumbs on every cpg page clickable random thumbs on every cpg page
 

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

clickable random thumbs on every cpg page

Started by michael singer, November 25, 2004, 05:22:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

michael singer

apart from being displayed at the cpg homepage, how can (linked) random thumbnails be shown also on the pages that are generated to display the main image and the filmstrip?  in other words, i would like to have random thumbs on EVERY page of my gallery.

is there a way?

i was searching the forum, but  this seems not to have been asked yet.

donnoman

This function is the function that is resposible for generating the thumbnails that are in the random block.


function display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)


This is the line we need to place in a couple files:

display_thumbnails('random', $cat, 1, $CONFIG['thumbcols'], 1, false);


Note: if you want to override the number of columns that are in the config: change "$CONFIG['thumbcols']" to that number.
And the following field is how many rows. Default is normally two, but I just did "1" in this example.

This line will display one row of random thumbnails from your current category.

You'll need to put it in a couple places to accomplish a random block on every page down to the intermediate picture.


Find in thumbnails.php, normally at line 135


display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
pagefooter();


change to:


display_thumbnails($album, (isset($cat) ? $cat : 0), $page, $CONFIG['thumbcols'], $CONFIG['thumbrows'], true);
display_thumbnails('random', $cat, 1, $CONFIG['thumbcols'], 1, false);
pagefooter();


find in displayimage.php, normally at line 641:


   theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
   pagefooter();


change to:


   theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
   display_thumbnails('random', $cat, 1, $CONFIG['thumbcols'], 1, false);
   pagefooter();


michael singer

thank you so much, donnoman!

it's only now that i read your reply, sorry for the delay, i forgot to activate the notification function for this thread.
your mod works really great!
thanks a lot for the help!

michael

donnoman