forum.coppermine-gallery.net

Support => cpg1.4.x Support => Older/other versions => cpg1.4 miscellaneous => Topic started by: JoshFed on September 06, 2007, 03:39:18 am

Title: Location of javascript that does onclick="MM_openBrWindow('displayimage.php?pid=
Post by: JoshFed on September 06, 2007, 03:39:18 am
I've modified this wonderful software to handle tiffs for the marketing department.  Thumbnails and intermediates are created as jpegs.  When you're browsing displayimpage.php and click on an intermediate it opens a new window with the full size jpeg, well it's not a jpeg, it's a tiff.  I want to change the onclick for tiffs to start a download instead of opening a new window. 

The problem is I can't find
Code: [Select]
onclick="MM_openBrWindow('displayimage.php?pid=... except in include/media.functions.inc.php where it is commented out. 

Does anyone know where that javascript code is located?
Title: Re: Location of javascript that does onclick="MM_openBrWindow('displayimage.php?
Post by: Nibbler on September 06, 2007, 04:21:36 am
scripts.js
Title: Re: Location of javascript that does onclick="MM_openBrWindow('displayimage.php?
Post by: JoshFed on September 07, 2007, 03:20:20 am
When viewing the page source for displayimage.php the following line responsible for the click and view the full size image feature.
Code: [Select]
<a href="javascript:;" onclick="MM_openBrWindow('displayimage.php?pid=878&amp;fullsize=1','52847172846e09d45a2c3c','scrollbars=yes,toolbar=no,status=no,resizable=yes,width=2777,height=3003')"><img src="albums/userpics/10002/normal_2_210.jpg" class="image" border="0" alt="Click to view full size image" /><br /></a>

I need to modify the source code that generates the above line.  I've been starring at html_picture_menu() in displayimage.php, where the above should be and it's not there.  When I comment out the call to html_picture_menu() in the main code block, no intermediate image is displayed, as would be expected.

scripts.js has the MM_openBrWindow function but I need to find where it is called to generate the above line.  I've grep'd all over looking for it.
Title: Re: Location of javascript that does onclick="MM_openBrWindow('displayimage.php?pid=
Post by: Nibbler on September 07, 2007, 03:28:31 am
Oh, I understand now. It's in theme_html_picture() which is either in theme.php or in include/themes.inc.php. You probably didn't find it with grep because the quote is escaped,

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')\">";
Title: Re: Location of javascript that does onclick="MM_openBrWindow('displayimage.php?
Post by: Joachim Müller on September 07, 2007, 09:39:53 am
Side note: if you want to change it, don't edit include/themes.inc.php, but themes/yourtheme/theme.php. If the function doesn't exist in your custom theme, copy it from themes/sample/theme.php. Definitions in your theme override the default given in include/themes.inc.php. For details, read http://coppermine-gallery.net/demo/cpg14x/docs/index.htm#theme_sample
Title: Re: Location of javascript that does onclick="MM_openBrWindow('displayimage.php?
Post by: JoshFed on September 07, 2007, 09:49:00 pm
Excellent!  That's what I was looking for.