[Solved]: Next image instead of full size image [Solved]: Next image instead of full size image
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

[Solved]: Next image instead of full size image

Started by Raug, May 29, 2009, 10:07:49 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Raug

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

Stevo

Create intermediate pictures  NO

This should do it (I guess)


Joachim Müller

@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.

Raug

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.

Joachim Müller

Thanks for returning and posting your solution.

hlabout

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

Joachim Müller