Member
Member
ekvernen   07-03-2009, 22:43
#1

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

Member
Member
sbillard   08-03-2009, 01:55
#2

No, but it is a pretty simple function, why don't you just copy the code to your theme and modify it?

Member
Member
ekvernen   10-03-2009, 19:16
#3

Thanks so much - delightfully simple, but I didn't think of it! It works now like a charm.

Member
Member
jrwills   04-07-2009, 05:38
#4

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\" [b]target=\blank[/b] title=\"A simpler web photo album\ …

[b]Note:[/b] the only thing I added was "[i]target=\blank[/i]"

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.

Administrator
Administrator
acrylian   04-07-2009, 08:06
#5

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.

Member
Member
jrwills   04-07-2009, 20:52
#6

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 [i]without[/i] 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?

Member
Member
sbillard   04-07-2009, 23:09
#7

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.

Member
Member
jrwills   05-07-2009, 06:18
#8

Thanks. Almost too easy :-)

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.