• 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;
    var settings;
    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;

    settings +=’,left=’+myLeft+’,top=’+myTop;
    }

    if(features!=”) settings +=’,’+features; // add features passed as argument
    ald_opw = window.open(”,winName,settings);
    with (ald_opw.document)
    {
    open(‘text/html’, ‘replace’);
    write(‘<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;\n’);
    write(‘<html xmlns=”https://www.w3.org/1999/xhtml”&gt;\n’);
    write(‘<head><title>’);
    write(myTitle);
    write(‘</title></head>\n’);
    write(‘<body style=”border:0;margin:0″>\n’);
    write(‘<img src=”‘+ theURL +'” ‘);
    write(‘title=”‘+ myTitle +'” alt=”‘+ myTitle +'” ‘);
    write(‘/>\n’);
    write(‘</body></html>\n’);
    close();
    }

    }
    =======================================================

    Here’s the link for Ajay’s plugin:
    https://ajaydsouza.com/wordpress/plugins/open-picture-window-plugin/#downloads

    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.

    https://www.hollywoodtuna.com

    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.

    https://www.zappelfillip.de/index.php/2005-10-25/zap_imgpop/

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • 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.

    Isn’t this what the inline uploader does in WP 2, in other words you click on the thumbnail and it takes you to a WP attachment page where you see the full-size image?

    Thread Starter bolonki

    (@bolonki)

    The images do not open in a new WP attachment page… do you you have an example of this? Other than the site I mentioned above, I haven’t seen any WP blog open images in a target page.

    Are your images opening in this WP attachment page you mention?

    Yep, after uploading an image and clicking on it in the browser area below the write post… there is a menu option appearing on the thumbnail: clicking on them they toggle, e.g. in the second row: Not linked > Linked to image > Linked to page. This last one will result in having the image in the post (after Send to editor) AND linked to an “attachment” page. Just try it ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Open Images in a WordPress page plugin’ is closed to new replies.