forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: titoi on July 12, 2006, 05:01:57 pm

Title: displayimage.php Javascript
Post by: titoi on July 12, 2006, 05:01:57 pm
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 (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 (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!!


Title: Re: displayimage.php Javascript
Post by: Sami on July 12, 2006, 05:50:12 pm
- first you need to change your default theme
no one can see your gallery they all see this
Code: [Select]
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>
Title: Re: displayimage.php Javascript
Post by: titoi on July 12, 2006, 07:01:49 pm
oh crap! I can't replicate the error! Will try to figure it out....
Title: Re: displayimage.php Javascript
Post by: titoi on July 12, 2006, 07:07:48 pm
Okay, "my gallery" is back. Does the site work for you now? It's never stopped working for me.  :o
Title: Re: displayimage.php Javascript
Post by: Joachim Müller on July 13, 2006, 05:56:38 am
works for me.
Title: Re: displayimage.php Javascript
Post by: Abbas Ali on July 13, 2006, 09:30:47 am
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

Code: [Select]
global $album, $comment_date_fmt, $template_display_media;

with

Code: [Select]
global $album, $comment_date_fmt, $template_display_media, $cat, $pos, $pic_count;

then Replace

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

Code: [Select]
            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
Title: Re: displayimage.php Javascript
Post by: titoi on July 14, 2006, 12:05:19 am
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!!
Title: Re: displayimage.php Javascript
Post by: Abbas Ali on July 14, 2006, 07:10:39 am
Did you made the first change i mentioned? i.e.
Code: [Select]
global $album, $comment_date_fmt, $template_display_media, $cat, $pos, $pic_count;
Title: Re: displayimage.php Javascript
Post by: titoi on July 14, 2006, 04:22:37 pm
Yes I did! Followed the directions exactly.
Title: Re: displayimage.php Javascript
Post by: Abbas Ali on July 15, 2006, 07:02:15 am
Attach the zip of your theme file to the next post (Using advanced options when posting)..
Title: Re: displayimage.php Javascript
Post by: titoi on July 15, 2006, 05:35:00 pm
okay, it's attached. Thank you for your help!
Title: Re: displayimage.php Javascript
Post by: Abbas Ali on July 17, 2006, 07:48:46 am
I forgot to add two lines in the code. I have modified my orginal post to reflect the changes...

In above code Replace

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

with

Code: [Select]
            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..
Title: Re: displayimage.php Javascript
Post by: titoi on July 17, 2006, 08:23:15 am
And it did! Many thanks!! This is now resolved.