View Full Version : clicked thumnails to open new window?
Can PP be modified so that, on the browse page of thumnails, when a thumnail is clicked, it opens the image page in a new window?
If it can be done, can someone please advise me of the file(s) I need to edit and what code needs to be added or changed.
T-I-A!
Dkozikowski
07-21-2007, 05:03 AM
It can be done quite easily but as a general rule in todays web-design, you never want to force your users to open up content in a new window if they don't want it to be.
The target element will actually cause W3C validation to fail using certain DOCTYPES.
So, with this in mind, here are the following steps involved:
[1] - Open the file functions_browse.php located within your includes folder.
[2] - Find the following code:
$thumb_output .= "<a href=\"$showprefix$id\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
[3] - and replace it with this:
$thumb_output .= "<a href=\"$showprefix$id\" target=\"_blank\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
Also, remember that this is considered a "hack" and when it comes time to upgrade Pixelpost, you must re-apply this "hack" for it to work again.
thanks for your assistance...I replaced the line as instructed...it does not appear to be working for me...I tried IE and FF. Here's the link:
http://www.augustakorean.com/main/postcards/index.php?x=browse
see if it works for you
---I see the target=blank line in each thumb A HREF tag, but it doesn't seem to be using it?
Dkozikowski
07-22-2007, 12:14 AM
:p
My fault. I had you put the target="_blank" within the img element. Of course this won't work as it needs to be in the href element.
I fixed my post above but here is the code again:
$thumb_output .= "<a href=\"$showprefix$id\" target=\"_blank\"><img src=\"$thumbnail\" alt=\"$title\" title=\"$title\" class=\"thumbnails\" /></a>";
Sorry about that. It was a long day ;)
ah...I should have noticed it myself! Works like a charm.. Thank you, sir!
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.