How to get printZenphotoLink() to open in a new window?

Hi all,
I'm looking for help with what I think is a pretty easy question - but I can't quite figure it out. I've installed Zenphoto on my website, and I'd like the Zenphoto credit link at the bottom of my gallery to open the Zenphoto website in a new window.

On my theme's index.php page, the function calling the zenphoto credit link is <?php printZenphotoLink(); ?>. Is there a way I can make this link open up in a new page without editing the zp-core files?

Thanks so much for any advice!
Elisabeth

Comments

  • No, but it is a pretty simple function, why don't you just copy the code to your theme and modify it?
  • Thanks so much - delightfully simple, but I didn't think of it! It works now like a charm.
  • For PHP illiterates like me, I will give you the "delightfully simple" solution that I fought with for more than an hour. :-)

    I went into the zp-core folder, found the "templates-functions.php" file, opened it up in Dreamweaver — yeah, yeah, I know… but I'm 64, give me a break :-) — searched for "printZenphotoLink" and then changed it to read:

    … href=\"http://www.zenphoto.org\" target=\blank title=\"A simpler web photo album\ …

    Note: the only thing I added was "target=\blank"

    I assume that since I haven't figured out where to "copy the code to your theme", I will have to make the change any time there is a version change.

    I would appreciate it if someone would kindly explain the last piece of this puzzle for me.
  • acrylian Administrator, Developer
    We recommend not to hack core files like template-functions.php as you will have to do that again with any update.
    It would have been `target="\blank\"` in that context btw. The quotes are important.

    The zenphoto link only links to our website. All themes have the `printZenphotoLink()` function at the bottom of the theme files , the main ones are index.php, album.php and image.php (detailed info about that on the theming tutorial). You can replace that function call with a plain link of course that opens automatically in a new window.

    Sidenote: Generally it is best practice to leaeve opening in a new window to the user as he can control that himself with his browser (via context menu or ALT+left click). Especially as most browsers use the more convenient tabs.
  • Thanks.

    I totally agree with your sidenote. I (finally) made the decision some time ago to leave the matter to users. In some cases, due to the expected audience, it required an explanation of the Shift or Ctrl-click function.

    I'm not sure how I got in on this except as I was looking for something, I came across this post and it bothered me that, as happens too many times in forums, people who know how to do something assume we all do. So I decided to see if I could figure it out.

    BTW target=\blank without the quotes worked. Are the quotes necessary or is it just best practice?

    Off topic a bit: speaking of hacking core files, is it safe to assume there is no way to implement a custom © without hacking the zp-core/watermarks folder?
  • YOu just make your watermark and place it in that folder. No need to change anything that is already there. THen select your custom copyright image as the watermark.
  • Thanks. Almost too easy :-)
Sign In or Register to comment.