Skip to content

IImage Browser Hack

The IImage Browser plugin for WordPress is an image management plugin that lets you browse through your uploaded images, upload new images, create thumbnails and generate code.

Just wanted to tweak one thing viz. Clicking on a thumbnail in a post should open the full image in a new browser window the size of the full image with no scrollbars, menu etc.

Update: Following the release of 1.4.5, the plugin has a custom code feature. This hack utilizes that feature now. Thus, you can retain the original functionality of the Plugin as well as add your own.

The hack:
1. Open iimage-browser.php

2. Find:

$ib_custom_code_thumb = 'Must be set in iimage-browser.php';

3. Replace with:

$ib_custom_code_thumb = '<a href="%src" onclick="window.open(this.href,'iimagebrowser','width=%width, height=%height'); return false"><img src="%tsrc" title="%title" alt="%title" width="%twidth" height="%theight" /></a>';

Download:
Download the hack here.

Leave a comment

  1. malyfred / Jun 1 2005

    well, we have custom codes for this in IImage Browser… maybe you could try to download newer version:)

  2. Ajay / Jun 1 2005

    I was running 1.4.3.

    Excellent feature addition. Modified the hack above :)

  3. Nyomi / Jun 26 2005

    I was excited to stumble across your hack; unfortunately it doesn’t seem to work quite right for me. The new window with the image opens up, but it doesn’t make it the dimensions specified. Instead I get a window that is not wide enough, and has way too much vertical space. I tested it in several different browsers on OS X (Firefox, IE and Safari) with similar results. Have you heard from anyone else with this problem?

    So, in the meantime I’m using LazyImageLayout’s code to handle the popups, which is fine except that another plugin I’m using (WP-Upload Manager) can’t locate the post the image is referenced in, which is the feature I really like about that pluggie. My workaround for that is adding the full path to the image in an HTML comment. Sort of an inelegant solution, but it works!

  4. Ajay / Jun 26 2005

    Hi Nyomi,
    Can I see a preview of this on your site maybe?

    Also, are you using the latest version of the IImage browser plugin?

  5. Doug LeMoine / Jul 1 2005

    Hi.

    I got your little hack working — thanks — EXCEPT for some reason the pop-up window sizing is weird. The width is perfect, but the height extends the length of the screen.

    See this weirdness in action by clicking on one of the thumbs here:

    http://www.douglemoine.com/diary

    Thanks again.

  6. Ajay / Jul 1 2005

    Hi Doug,

    I can see the popup window of the correct width and height in Internet Explorer.

  7. Doug LeMoine / Jul 1 2005

    Hmm.

    I use Firefox, and the window extends to the bottom of the screen. I’ll look around and see if I can find any answers …

    Thanks for your help,

    Doug

  8. Nyomi / Jul 1 2005

    It definitely seems to be a Firefox/Mozilla and Safari issue (not IE as I said earlier). I have heard that Ajay is working on a new solution. ;)

    Also, the live preview is cool, what pluggie is it?

  9. Ajay / Jul 1 2005

    @Doug:
    I understand now the problem. But it is specific to Firefox.
    Though as of this date I am not aware of a solution.

    Will look around and see what I can find.

    @Nyomi:
    Live Comment Preview Plugin

  10. Ajay / Jul 1 2005

    @Doug:

    I have corrected the hack. There needed to be a comma ( , ) after the width and before the height in the window.open properties for Firefox to recognize it.

  11. Doug LeMoine / Jul 1 2005

    Where is the comma placed?

    Here’s what I’ve got now:
    window.open(“”,”imageviewer”,”width=”+ix+”,height=”+iy+”,menubar=no,toolbar=no”);

    There is a comma there; perhaps it’s misplaced?

  12. Ajay / Jul 1 2005

    Please download the hack here.

  13. Doug LeMoine / Jul 2 2005

    Okay, now I get it.

    I needed to add the comma to the properties of the custom_code_thumb in the iimage-browser.php file, not in the javascript function in the header.

    Now it all works. Thanks!

  14. Stahn / Nov 29 2005

    Hi, I wanted to report a problem with Firefox 1.5 RC3, can you check what’s the problem? I took a screenshot.

    The white space around the image is on top, left, bottom but not right.
    A solution will not a bigger height and widht because it will screw up the other browsers.

    The plugin works great on Opera 8.5.0

  15. Ajay / Nov 29 2005

    Thanks Stahn for reporting the problem.

    I am aware of it. You will notice the same even on Internet Explorer. It is the way the browser automatically adds padding to the top and left.

    I’m working on a solution that may not work with this hack directly but will work when used with my Open Browser Plugin.

    Read this hack.

Trackbacks and Pingbacks

  1. .: HK Vie :. » WP Plugin: IImage Browser & Hack

Comments are closed.