forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 themes/skins/templates => Topic started by: Raug on May 29, 2009, 10:07:49 pm

Title: [Solved]: Next image instead of full size image
Post by: Raug on May 29, 2009, 10:07:49 pm
I tried searching but I didn't see anything related to this.  Maybe I was using the wrong words.

What I want to do is have the next image be displayed instead of the fullsize image when you click it.  I already have the images showing at full size so make it popup with the same image isn't doing anything for me.

Is there a way to do this?  I'm guess it could be done by making the picture have the same link as the forward arrow in displayimage.php, but I wouldn't know where to change that :X
Title: Re: Next image instead of full size image
Post by: Stevo on June 02, 2009, 10:53:07 pm
Create intermediate pictures  NO

This should do it (I guess)

Title: Re: Next image instead of full size image
Post by: Joachim Müller on June 03, 2009, 07:59:38 am
@Stevo: No, that's wrong. Raug asked for something completely different.

@Raug: I'm sure that a mod to accomplish this has been posted a long time ago on this board, but I can't remember where nor who posted it. Please perform a thorough search. You'll have to modify themes/yourtheme/theme.php, the code you need to edit resides within function theme_html_picture() - that's all I remember out of the back of my head.
Title: Re: Next image instead of full size image
Post by: Raug on June 03, 2009, 08:46:08 am
Actually, I managed to get this done myself after a bit of tinkering.  I know almost no php so I was surprised I got it done (I took 2 years of computer science during HS and then I only learned Java, lol :X ).  I'm not sure if this is going to work all the time, but here are the changes I made.

I added these two lines to theme_html_picture() at the top
global $pos, $nextimg;   
$nextimg = $pos + 1;


and then changed this section

if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href=\"javascript:;\" onclick=\"MM_openBrWindow('displayimage.php?pid=$pid&amp;fullsize=1','" . uniqid(rand()) . "','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=$winsizeX,height=$winsizeY')\">";
            $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {
         

to this

if ($mime_content['content']=='image') {
        if (isset($image_size['reduced'])) {
            $winsizeX = $CURRENT_PIC_DATA['pwidth']+5;  //the +'s are the mysterious FF and IE paddings
            $winsizeY = $CURRENT_PIC_DATA['pheight']+3; //the +'s are the mysterious FF and IE paddings
            $pic_html = "<a href='?album=$album$cat_link&amp;pos=$nextimg'>";
    $pic_title = $lang_display_image_php['view_fs'] . "\n==============\n" . $pic_title;
            $pic_html .= "<img src=\"" . $picture_url . "\" class=\"image\" border=\"0\" alt=\"{$lang_display_image_php['view_fs']}\" /><br />";
            $pic_html .= "</a>\n";
        } else {

In all the tests I've done, it seems to work so hopefully I didn't end up breaking something else in another part of the gallery.
Title: Re: Next image instead of full size image
Post by: Joachim Müller on June 03, 2009, 08:58:19 am
Thanks for returning and posting your solution.
Title: Re: [Solved]: Next image instead of full size image
Post by: hlabout on August 30, 2009, 09:21:44 am
Love this mod and implemented it myself.
Thanks for the useful information. ;D
Did you observe any negative behavior in your Gallery after the above changes?

Harald

www.haraldlabout.nl/fotografie
Title: Re: [Solved]: Next image instead of full size image
Post by: Joachim Müller on August 30, 2009, 12:53:57 pm
Locking