Ajay has written a plugin that makes all images open in a new window, it’s a very nice plugin, and I want to modify the code so that the image opens in a dedicated WordPress window. Perhaps someone can check the code below and tell me where should I add the URL for the landing page, and what code should there be in the “landing” (page if any) to receive this image.
/* Open Picture Window */
function ald_OpenPictureWindow(theURL, winName, features, myWidth, myHeight, isCenter, myTitle)
var ald_opw = null;
settings = ‘width=’+myWidth+’,height=’+myHeight;
if(!myTitle) myTitle = “Brought to you by Open Picture Window Plugin”;
if(isCenter) // Position in center of window
var myLeft = (screen.width) ? (screen.width-myWidth)/2 : 0;
var myTop = (screen.height) ? (screen.height-myHeight)/2 : 0;
if(features!=”) settings +=’,’+features; // add features passed as argument
ald_opw = window.open(”,winName,settings);
write(‘<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>\n’);
write(‘<img src=”‘+ theURL +'” ‘);
write(‘title=”‘+ myTitle +'” alt=”‘+ myTitle +'” ‘);
Here’s the link for Ajay’s plugin:
Here’s a WordPress blog that does what I want to do, that is it opens all images in a special WordPress page that has the header, a “back to the blog” link, and a few ads.
In case it’s easier for someone, here’s another plugin by Zappelfillip that does something similar, in this case the images will show up in a popup window.
I am actually surprised that nobody implemented this for WP yet, seems to me a part of an integrated blog experience to have images open within the blog environment rather than “on their own” in a blank browser page with no WP header or footer, “back to blog” thing, etc. This feature has been standard with Movable Type for ever. My point is, if you help out figure what to modify, I am sure a lot of people will begin using this “open image in WP page” plugin as it rounds up the image experience for the blog. The image will not be treated as an “orphan” anymore, it will be owned by the blog which will display it along with a header, footer, etc.
Thanks for any help or suggestions
PS: Yes, I did ask Ajay and Zappelfillip for help with modifying the plugin so that it opens in a dedicated WordPress page; Ajay say maybe later and Zappelfillip said no.
- The topic ‘Open Images in a WordPress page plugin’ is closed to new replies.