forum.coppermine-gallery.net

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Miscellaneous => Topic started by: michael singer on November 25, 2004, 05:22:27 pm

Title: clickable random thumbs on every cpg page
Post by: michael singer on November 25, 2004, 05:22:27 pm
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.
Title: Re: clickable random thumbs on every cpg page
Post by: donnoman on November 26, 2004, 01:37:18 am
This function is the function that is resposible for generating the thumbnails that are in the random block.

Code: [Select]
function display_thumbnails($album, $cat, $page, $thumbcols, $thumbrows, $display_tabs)

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

Code: [Select]
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

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

change to:

Code: [Select]
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:

Code: [Select]
   theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
    pagefooter();

change to:

Code: [Select]
   theme_display_image($nav_menu, $picture, $votes, $pic_info, $comments, $film_strip);
    display_thumbnails('random', $cat, 1, $CONFIG['thumbcols'], 1, false);
    pagefooter();
Title: Re: clickable random thumbs on every cpg page
Post by: michael singer on November 27, 2004, 11:18:22 am
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
Title: Re: clickable random thumbs on every cpg page
Post by: donnoman on November 27, 2004, 08:39:03 pm
Glad to hear it, your welcome.