Location of javascript that does onclick="MM_openBrWindow('displayimage.php?pid= Location of javascript that does onclick="MM_openBrWindow('displayimage.php?pid=
 

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

Location of javascript that does onclick="MM_openBrWindow('displayimage.php?pid=

Started by JoshFed, September 06, 2007, 03:39:18 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

JoshFed

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 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?

Nibbler


JoshFed

When viewing the page source for displayimage.php the following line responsible for the click and view the full size image feature.
<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.

Nibbler

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,

            $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')\">";

Joachim Müller

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

JoshFed