JavaScript and Contact Form Help Needed...

Hello,
Firstly, I'd like to say that ZenPhoto is absolutely fantastic. Rarely have I used a free script from the internet and it just works. I like the concept: it begins simple, but you can customize it with much more advanced code. Thank you for making such a user-friendly gallery script.

Anyway, I do have two questions about ZenPhoto:

1. My JavaScript doesn't work. For example, if you click the "Admin Toolbox" link (which has a javascript reference) it doesn't do anything. How can I fix that?

2. Regarding the Contact Form extention: how do you implement it into the gallery? When I go to the plugin options page, it shows me that it is enabled. But when I click the contact_form link to expand its options, it doesn't show me how to show it in the gallery.

Thank you. All and any help is appreciated.

Comments

  • acrylian Administrator, Developer
    1. What browser and version?
    2. You need to create a new custom theme page (contact.php for example) and put the printContactForm() function on it. Info on custom pages on our theming tutorial.
  • Firefox 2.
  • Check to see that Javascript is enabled in your browser.
  • Hmmm... I definitely know that Javascript is enabled. However, I know that I had some problems uploading the script directory to my site. Maybe it didn't transfer the Javascript. Should I re-upload "zp-core" or a different directory?
  • You can just re-upload the zp-core/js folder.
  • That didn't work. But, I think I know the problem: the links to the Javascript in the header are bad. They relink to the /zenphoto folder, so instead of having a link like this
    ``
    I get a link WITH the /zenphoto added at the biginnging:
    ``
    So the server would look for the file at /zenphoto/zenphoto/zp-core/js/ instead of just one /zenphoto.
    I think that's the problem...
  • Uh.. nope that didn't fix it.
  • acrylian Administrator, Developer
    It is working with FF 2 on Mac so I doubt it is an browser issue. Please make sure that your really uploaded all files correctly.
  • If the server was actually doing as you suggest, doubling the `zenphoto` part then the server is seriously flawed. The link is absolute, not relitive. Did you try re-uploading the js folder?
  • Yeah, I tried re-uploading the JS folder. In fact, I even tried writing another new, fresh version (of the complete /zenphoto folder) to the server. JS still did not work.
  • Ok, one last attempt:

    First, what version of zenphoto are you using?
    Second, do you get any js errors reported by your browser?
    Third, have you tried different browsers?
  • 1. The most recent version (1.2.4)
    2. Yes, when I click a link that refers to a javascript (`` for example, the icon near the search box) I get a "toggle is not defined" error.
    3. Yes, but with no avail

    The links at the top of the code (that refer to the javascript files) all work. I've put them in my browser and the file was found.

    The "toggle not found" error leads me to believe that there is a problem of where the javascript is defined. Is there any PHP document pertaining to the javascript functions?
  • I do think I've found the problem: I get a fatal error in the /zp-core/js/zenphoto.js.php file:
    `
    var zpstrings = {
    /* Used in jquery.editinplace.js */
    'Save' : "
    Fatal error: Call to undefined function gettext() in root/zenphoto/zp-core/js/zenphoto.js.php on line 22
    `
    I also get an error on the page for an 'unterminated string liberal,' referring to the uncompleted "save" function in the code above.

    Hmm.. how to fix this?
  • does setup say anything about gettext()?
  • add:
    `
    if(!function_exists("gettext")) {
    // load the drop-in replacement library
    require_once(dirname(dirname(__FILE__)).'/lib-gettext/gettext.inc');
    }
    `
    after
    `if (!defined('ZENFOLDER')) { define('ZENFOLDER', 'zp-core'); }`

    in `zenphoto.js.php`
  • Yes, finally it worked! Thank you for your help and time.
Sign In or Register to comment.