Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MM_openBrWindow definition?

Status
Not open for further replies.

OsakaWebbie

Programmer
Feb 11, 2003
628
JP
I downloaded and installed a web tool (Coppermine Photo Gallery, if you're curious), and it looks like a very solid application. But it makes repeated calls to a Javascript function called MM_openBrWindow, which my browser claims is not defined. I did a search through the files, but that function does not appear to be defined anywhere within the code provided. The Internet is full of references to calling such a function but not much about defining it, so I'm assuming I'm missing something fundamental.

Is MM_openBrWindow a common Javascript function that I should already have somehow? The "not defined" error occurs in both IE 6.0 and Firefox 2.0.
 
Okay, if so, there is no mention that Dreamweaver would be required to use it. It's not someone's personal homegrown concoction - it's a a standalone distribution offered by SourceForge, written and updated by a team of people, thoroughly documented.

So what should I do? I tried looking for a globally used include file containing the HTML header code, so I could just add a little function (that would just call window_open - I don't know if that would be enough or not), but it wasn't that simple - the code is very complex, there is no file used by all pages, and that function is called in a number of places. There was no mention of this problem on the Coppermine support forum, and when I decided to register with that forum, the activation email was missing its message body (some bug with the engine that runs their forum, I guess), so I can't ask other Coppermine users directly. That's when I decided to turn to my trusty Tek-tips friends...
 
you're either missing a file, or you're pointing to the incorrect directory. hard to help without knowing any details about your app, environment, setup, etc. we can only guess so much.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
My environment is PHP/MySQL, the application is the newest stable version found on coppermine-gallery.net, and I followed the installation directions they provided. The application is way too complex to try to describe its setup, directory structure, and files (plus, I didn't write it, so it would take me a long time to reverse engineer it in order to explain).

I had renamed a directory at one point, and thought that might be related to the problem, so I reinstalled the whole thing from scratch just to make sure, but there was no change. Then I used GoLive's site search function to search all the files for a definition of the function, and I didn't find it anywhere in the distribution. You can see it in action at oicjapan.org/gallery (of course you can't see the PHP code that way, but this is a Javascript question anyway). Where I noticed the problem first is when you click on a medium-sized photo to view it full-size - the window never pops up and the error console complains of MM_openBrWindow not being defined.

My original question was whether that function was something basic that I should already have somehow. You seem to be saying that's not the case, and no one else is jumping into the conversation, but it seems strange that such a well-developed package would not have what it needs.
 
a quick google search yielded this code for the mm_OpenBrWindow function:

Code:
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

you can try adding that to your javascript file and see if that helps. as for why a file would be excluded, i'm afraid only the code owner can answer that.



*cLFlaVA
----------------------------
[tt]"quote goes here"[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
Hey, that was it! I did expect it to be something silly like that. Scripts.js did exist, but it was in the "root" gallery directory, not the themes/red directory. For some reason, (a) GoLive did not search the scripts.js file when I was looking for the function definition, (b) somehow "themes/red/" got added to the path when I was making my custom theme (perhaps when I duplicated a different theme to start from), and (c) I looked right past the link to scripts.js when I was looking through the browser's source code view for exactly that kind of thing.

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top