Problems with Thickbox on image.php :(

I'm afraid this might be one of those dreaded "stupid questions", but here it goes.

I searched the forum and the guides for something that might clue me in on what the problem might be, but no such luck.

The thing is, Zenphoto is, as far as I can tell, working fine. However, I don't know why Thickbox doesn't work on image.php as it should (looking at the source, it doesn't seem to be adding class="thickbox" to the image).

The test site can be found here. It's using the zenphoto-2009-11-21-trunk.zip nightly build, and the theme is based on the "Default" one. Using the Default theme got the same results. I also tested in my local server both the official download and the latest nightly, zenphoto-2009-11-23-trunk.zip, and the results were the same.

Any help would be appreciated. I'll keep studying image.php to see if there's something I've overlooked. Thanks.

Regards,

Ed

Comments

  • acrylian Administrator, Developer
    You did not tell what theme you are using. You have to modify your image.php file for thickbox by adding that class and the appropiate url yourself.

    See the image.php of the zenpage-default theme for an example (there is some more stuff as it can be disabled optionally) and the thickbox site itself for info about that.
  • The theme I am using is based on the Default Zenphoto theme. I just copied and pasted verbatim all appropriate lines from Default into the new skin, tweaking the CSS here and there (nothing major). The thing is, the issue happens *even* with the Default theme, at least to me.

    I'll try to take some time tonight to give an even closer look at image.php to see what I can find. Since I can't find anyone complaining about this in the forum, I guess it's either something rare, or something that everyone is figuring out on their own (except dumb ol' me :).

    Thanks for the reply. :)

    Ed
  • I feel silly. Well, of course the full image didn't open using Thickbox: the Default theme (which I use in my customized theme) uses the script only to display the image's metadata, and not the full version of the image.

    I think I found the place where I must insert it. (NOTE: the forum kept deleting parts of the code, so I susbstituted < > with [ ]... sorry if that makes it harder to read):
    `

    [?php

    $fullimage = getFullImageURL();

    if (!empty($fullimage)) {

    ?]

    [a href="[?php echo htmlspecialchars($fullimage);?]" title="[?php echo getBareImageTitle();?]"]

    `

    I placed class="thickbox" here:

    `

    [a href="[?php echo htmlspecialchars($fullimage);?]" title="[?php echo getBareImageTitle();?]" class="thickbox"]

    `

    And sure enough, thickbox is called, the overlay appears and something appears, only it's not the image. Thickbox apparently doesn't like the link that's being passed to it (for instance,
    /cboy/zenphoto/zp-core/full-image.php?a=laborers&i=78630169.jpg&q=75, instead of the actual URL to the image), and all I get is a long string of gobbledygook.

    I managed to get this far, but I'll probably need help with the rest since I'm not exactly a PHP guru. How can I get Zenphoto to echo the actual url of the full-sized image so that TB can display it? :(

    Regards,

    Ed
  • I could never get thixbox to pull the full-size image properly, and then when I looked at the thickbox site I notice that it's no longer being supported. My only suggestion is to reference against how the zenpage-default theme does it as it has the ability to display in thickbox.
  • acrylian Administrator, Developer
    Thickbox may not be officially supported (which is quite new) anymore but it still works...;-) However we may switch to one of the other "Box" scripts next year as we plan to do some JS reworking to match up with the recent jQuery behind the admin surface regarding the drag and drop sorting (we use an older version because of that. "Don't fix it if it ain't broken"..;-)).

    The zenpage default theme has an option to show the full image with the thickbox. Just follow the instructions on the thickbox site.

    Regarding code on the forum you have to use "backticks" to get it shown correctly (the key left to backspace + SHIFT).
  • I had similar battle to get thickbox to work, with strange URL, and string of gobbledygook. I think I changed Options > Images > Full image protection: to Unprotected (and disable hotlinking). That is the setting I have now, and it works
  • acrylian Administrator, Developer
    Yes, with full image protection thickbox (or other "box" scripts) do not work (makes senses, doesn't it). This has been discusssed here lots of times on the forum.
  • I did try to use the backticks, but for some reason the forum always "ate" the < a > tag, often together with "href." Anyway, sorry acrylian, I should have thought of my last question as a "separate issue" and done another search. :-P

    Still, thanks digitalsafaris for kindly pointing out the final solution to me.

    My original problem wasn't really related to Thickbox (which I've used before), but with where to insert the call on image.php. I'm still all thumbs when it comes to PHP and couldn't "see" where the image tag was. I also got confused because there IS a call to TB on image.php... and only after using Firebug to check the page (and remembering what the "Image Info" link did), I realized the call to TB was only used to present the metadata of the pic. Yeah, it was a "duh" moment. It was then that I could see where the class="thickbox" attribute needed to be inserted.

    Anyway, it was fun, and I learned something. Thanks to all of you who posted here.

    Ed.

    P.S. Would it be possible to add digitalsafaris' solution to the Troubleshooting Zenphoto FAQ (that ZP's image protection blocks the "box" scripts)?
  • acrylian Administrator, Developer
    Sure, I will add an entry about the image protection issue (which is no issue actually). I somehow thought we had already one...

    Regarding backticks, the space after typing the first backtick is the important thing to do, otherwise you "delete" it and the code gets mixed up. A little tricky but once you got it..;-)
  • Well, sure I understand it isn't an issue. The image protection does what it's supposed to do. But it might help another clueless noob like me to avoid asking the same thing again in the forum :).

    Thanks for the backticks tip.

    Ed
Sign In or Register to comment.