displayimage.php Javascript displayimage.php Javascript
 

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

displayimage.php Javascript

Started by titoi, July 12, 2006, 05:01:57 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

titoi

My apologies if this is the wrong place for a question like this, please let me know if there's a better place for it.

I don't know much of anything about coding so I'm kinda flying blind on this. I just upgraded to Coppermine 1.4.8, I'm using a modified version of DaMysterious' kaki theme and I've installed Casper's Paypal mod (http://forum.coppermine-gallery.net/index.php?topic=26454.0). (Not sure if any of that's important, but I figured it could help).

Currently when looking at a full size image (for example, this one: http://www.titoi.com/galleries/displayimage.php?album=5&pos=14), if you click on the image itself, it opens in a new window. The new window, when expanded, shows the Paypal mod but it doesn't work properly. I'd like to make it simply advance to the next image instead of opening any new windows. I tried finding out where the code is for the next.gif with the intention of swapping it for the javascript, but didn't have any luck. Any suggestions on where it might be, and if this will accomplish what I'm trying to do? Thank you!!



Sami

- first you need to change your default theme
no one can see your gallery they all see this

Template error
Failed to find block 'my_gallery'(#(<!-- BEGIN my_gallery -->)(.*?)(<!-- END my_gallery -->)#s) in :

                <span class="topmenu">


<!-- BEGIN allow_memberlist -->
                        <a href="{MEMBERLIST_TGT}" title="{MEMBERLIST_TITLE}">{MEMBERLIST_LNK}</a><br /><br />
<!-- END allow_memberlist -->



<!-- BEGIN faq -->
                        <a href="{FAQ_TGT}" title="{FAQ_TITLE}">{FAQ_LNK}</a><br /><br />
<!-- END faq -->





<!-- BEGIN upload_pic -->
                        <a href="{UPL_PIC_TGT}" title="{UPL_PIC_TITLE}">{UPL_PIC_LNK}</a><br /><br />
<!-- END upload_pic -->

<!-- BEGIN register -->
                        <a href="{REGISTER_TGT}" title="{REGISTER_TITLE}">{REGISTER_LNK}</a><br /><br />
<!-- END register -->

<!-- BEGIN login -->
                        <a href="{LOGIN_TGT}" title="">{LOGIN_LNK}</a>
<!-- END login -->


</span>
‍I don't answer to PM with support question
Please post your issue to related board

titoi

oh crap! I can't replicate the error! Will try to figure it out....

titoi

#3
Okay, "my gallery" is back. Does the site work for you now? It's never stopped working for me.  :o

Joachim Müller


Abbas Ali

#5
Following mod will change the link on intermediate pic so that instead of opening the pop for fullsize pic the user will be taken to the next pic (as if he clicked the Next button).

Edit themes/yourtheme/theme.php (function theme_html_picture) [If that function is not there in your theme then copy it from sample theme to your theme.php]

Replace


global $album, $comment_date_fmt, $template_display_media;


with


global $album, $comment_date_fmt, $template_display_media, $cat, $pos, $pic_count;


then Replace


            $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";


with


            if ($pos < ($pic_count - 1)) {
              $next = $pos + 1;
              $cat_link = is_numeric($album) ? '' : '&amp;cat=' . $cat;
              $pic_html = "<a href=\"{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$next$uid_link\">";
            }
            $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 />";
            if ($pos < ($pic_count - 1)) {
              $pic_html .= "</a>\n";
            }


HTH
Abbas
Chief Geek at Ranium Systems

titoi

Thank you very much for that! The function was not in my theme (kaki), so I added it and made the changes. Now it does stop it from opening a new window, but it does not advance to the next image. The link in each case is going to displayimage.php?album=(number)&pos= with nothing after the =. Any other suggestions? Thanks in advance!!

Abbas Ali

Did you made the first change i mentioned? i.e.

global $album, $comment_date_fmt, $template_display_media, $cat, $pos, $pic_count;
Chief Geek at Ranium Systems

titoi

Yes I did! Followed the directions exactly.

Abbas Ali

Attach the zip of your theme file to the next post (Using advanced options when posting)..
Chief Geek at Ranium Systems

titoi

#10
okay, it's attached. Thank you for your help!

Abbas Ali

I forgot to add two lines in the code. I have modified my orginal post to reflect the changes...

In above code Replace


            if ($pos < ($pic_count - 1)) {
              $pic_html = "<a href=\"{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$next$uid_link\">";
            }


with


            if ($pos < ($pic_count - 1)) {
              $next = $pos + 1;
              $cat_link = is_numeric($album) ? '' : '&amp;cat=' . $cat;
              $pic_html = "<a href=\"{$_SERVER['PHP_SELF']}?album=$album$cat_link&amp;pos=$next$uid_link\">";
            }


This should do the trick..
Chief Geek at Ranium Systems

titoi

And it did! Many thanks!! This is now resolved.