Thickbox Caption

Powers / 2008-05-18 23:45:11   

I've noticed that the caption for an image does not display in a thickbox gallery when you click on a thumbnail. How do I add this in?

Vaska A / 2008-05-19 07:41:37   

Yes it does.

Powers / 2008-05-23 17:50:11   

No it doesn't.

For each image you have a Image Title and Image Caption. The title displays but the Caption does not display.

Vaska A / 2008-05-23 17:53:17   

Show us?

Powers / 2008-05-23 17:54:39   

Looking at the jquery.thickbox.js it seems you are defining the title as caption, but the


// get caption: either title or name attribute var caption = this.title || this.name || "";

Powers / 2008-05-23 17:55:09   

Looking at the jquery.thickbox.js it seems you are defining the image title as caption, but the image caption is left out.


// get caption: either title or name attribute var caption = this.title || this.name || "";

Powers / 2008-05-23 17:57:57   

http://julianpowers.net/index.php?/project/test/

All the pictures in the second column have "detail" as the caption. This doesn't show up.

Vaska A / 2008-05-23 18:09:55   

Well I'll be a darned...I wonder how many people this one got by? ;)

Your site doesn't have an email address...I'll send you the fix.

But you need to agree to name your first 14 kids "Indexhibit" first. Good? OK!

And thanks for the debuggery...

Vaska A / 2008-05-23 18:21:17   

Ok...you only need to name your first 12 kids "Indexhibit"...but I need to go to dinner. Here is the file...just replace the existing file in your /ndxz-studio/site/plugin/ folder and then do a hula dance.

Let me know if there are another other problems...

Updated Thickbox Exhibition Plugin

Powers / 2008-05-23 18:30:13   

Thanks.

apelmac / 2008-08-12 18:06:54   

Hi, i'm trying to download the new Updated Thickbox Exhibition Plugin but the link is missing. If you can send it to me i appreciate it.
Thanks!

apelmac / 2008-08-12 19:26:04   

I download it. Maybe the problem was with my ISP. Thanks.

giantrobot / 2008-08-13 04:15:37   

Powers- I notice that your captions are beneath the title, but mine or on the same line. Did either of you do anything special to the new exhibit.thickbox.php that made it do this?

I would like mine to be on 2 different lines, like yours. Thanks.

abramelin / 2008-08-13 12:10:39   

@giantrobot

just put a br tag before your caption title, thats all.

giantrobot / 2008-08-13 13:43:34   

Of course! Sorry, I thought that you found a way to implement that in the .js or .php.

Any idea on how to it that way so that there is no need to enter it in each caption?

Yorb / 2009-01-26 05:04:22   

Thanks for the fix, Vaska.

  1. <blockquote>Any idea on how to it that way so that there is no need to enter it in each caption?</blockquote>
  2. Just take the replacement plugin file and change line 56 from:
  3. ¬†¬†¬†¬†¬†¬†¬†¬†$title ¬†¬†¬†¬†¬†¬†¬†¬†.= ($go['media_caption'] == '') ? ' ' : ' ' . $go['media_caption'];
  4. to
  5. ¬†¬†¬†¬†¬†¬†¬†¬†$title ¬†¬†¬†¬†¬†¬†¬†¬†.= ($go['media_caption'] == '') ? ' ' : '<br />' . $go['media_caption'];

That should do it.

Yorb / 2009-01-26 05:07:19   

btw, i have absolutely no idea why it decided to number my entries. also, that line isn't exactly how i pasted it...there should be non-breaking spaces somewhere in there. just find the ' ' after the : and change it to include a break instead of a space as the divider. if that makes sense.

jasonb / 2009-03-11 22:50:32   

Hi.

I implemented the above fix for thickbox, including the fix for the tag.

now I'm having this issue with an item (michel gondry) in the slideshow.

http://www.helenesilverman.net/index.php?/work/book-design/

it's showing part of the tag in firefox. the alt tag seems to be spaghettied for some reason.

any ideas? thanks.

jasonb / 2009-03-11 23:40:11   

fixed it. too many has single prime (') characters in the title field. looks like it screwed up the code. make sure you use the proper quote characters in those.

i have another question:

when you hover over the thumbnails you see the title and the caption, with any html tags that are in there. any way to avoid this, or can I just have the titles show up in the alt field?

thanks.
jason

drummermoe / 2009-04-14 19:04:57   

I too have successfully implemented the fix. But now I have another question. I've looked in both the php and css files for thickbox to see if I could bold the title of my images, but when I changed the code it changed both image title and caption. Any way where I can only do the title and not the caption? (Or really edit the title and caption separately since that's what I'd prefer to do really.)

www.melisaoporto.com/projects/firehouses

  1. This is what I changed. From:#TB_caption {
  2. ¬†¬†¬†¬†padding: 21px 0 6px 0;
  3. ¬†¬†¬†¬†text-align: center;
  4. ¬†¬†¬†¬†font-size: 14px;
  5. ¬†¬†¬†¬†font-weight: bold;
  6. }To:#TB_caption {
  7. ¬†¬†¬†¬†padding: 21px 0 6px 0;
  8. ¬†¬†¬†¬†text-align: center;

}

drummermoe / 2009-04-14 19:09:32   
Gah. I'm still getting used to posting on this forum.
From:
#TB_caption {
padding: 21px 0 6px 0;
text-align: center;
}

To:
#TB_caption {
padding: 21px 0 6px 0;
text-align: center;
font-size: 14px;
font-weight: bold;
Vaska A / 2009-04-14 19:21:49   

On line 138 (or so) of the /ndxz-studio/site/js/thickbox.js file it has the final output of the title and caption. Thickbox combines the two into one line it seems (or maybe I did this) so if you wanted to change this...this would be the place to do so. But you will need to root around the code and see exactly where things are combined, etc.

Oh wait, I think Thickbox uses the 'title' from the img tag so I'm not sure you have any other options here. Yes, could edit this up to make it happen, but it's for people with solid html and javascript skills to make happen.

drummermoe / 2009-04-14 19:50:56   

Hmmm. Alright. I guess I'll have to find someone more advanced in coding than I am to help me out.

And if I somehow get this to work would that also be where I can fix why the title and caption show up in the alt tag?

Vaska A / 2009-04-14 19:52:18   
You could ask people at the Thickbox forum...tons of information there.
puppiepoppy / 2009-12-18 17:49:17   

Dear Vaska,

In refer to your above posting dated 2008-05-23 18:21:17, is it more beneficial to the readers if you could put a downloadable link in your Download page?

I'm a (quite) new Indexhibit user here and uses Thickbox format click my sample here. However, the existing Indexhibit CMS v0.70e does not contain that particular plug-in that you've mentioned (dated 2008-05-23 18:21:17).

It's just my suspicious since my current site doesn't have that Image Caption matter fixed yet.

Your CMS v0.70e is dated even earlier than your new Thickbox Indexhibit Plug-in. Correct me if I'm wrong.

Really appreciate all the great stuffs we're learning here at Indexhibit! Awesome!

Cheers,
Mike

kks / 2010-12-07 16:38:24   

Hi All, Please excuse the redundancy. I can not seem to download the updated thickbox php and would like to fix the caption. could anyone cut and paste the code into the forum or direct me to another thread with more information. been searching for a while and can only seem to find partial fixes.

Best,
KK

arsondpi / 2010-12-07 17:29:51   

huh? Go to Settings -> Advanced Mode and check if it's set to On. Indexhibit comes with thickbox preinstalled.

kks / 2010-12-08 15:14:22   

Hi, Sorry, didn't realize I was being unclear. I'm currently using the thickbox plugin on a friend's website but as others have mentioned in this forum only the title shows up, not the title and the caption. I've tried to go into the code and figure out what is wrong, but I can't seem to find the fix. Vaska posted about it (http://www.indexhibit.org/forum/thread/1039/#post_5602) as well as a fix (http://www.indexhibit.org/downloads/exhibit.thickbox.php.zip) but this link does not work.For an example please see:http://suzannelacke.com/index.php?/projects/dresses/

Thank you

abarem / 2011-01-01 12:50:17   

I am looking for the same answer as KKS please.
thanks & happy new year!!

abarem / 2011-01-01 12:50:31   

I am looking for the same answer as KKS please.
thanks & happy new year!!

rosaliogalvan / 2011-02-09 15:57:44   

The caption is not appearing for me either,
any help appreciated.
thanks

durango / 2011-02-11 18:35:11   

Hello. I as well cannot download the update for thickbox.
Please help.
Thank you very much.
Jac

argh / 2011-03-27 16:41:55   

hi vaska, thanks so much for indexhibit, its absolutely great!
but...i´m having the same problem as most people in this thread:
in thickbox the title is visible, but not the caption, and the link for the fix you posted about three years ago doesn´t work. could you please post it again?

argh / 2011-03-27 16:42:18   

hi vaska, thanks so much for indexhibit, its absolutely great!
but...i´m having the same problem as most people in this thread:
in thickbox the title is visible, but not the caption, and the link for the fix you posted about three years ago doesn´t work. could you please post it again?

IvyGirl / 2011-03-28 12:27:02   

Hi. I'm having the same problem as the people in this thread. I am very new to programing language, can someone please walk me through what to do in very plain English? Thank you.

IvyGirl / 2011-03-28 13:51:40   

http://www.ivstudios.com/index.php?/recent/recent-work/

The title/caption in the thickbox cuts off the information in the middle. If you look at the lower images it was working correctly. I never changed anything, so does anyone know what the problem might be and how to fix it? Thanks.

wiesedruck / 2011-03-28 21:53:43   

argh and Ivy Girl-

The link does work but you have to control (or command) click on it.
Chose 'save link as...' and save it to somewhere on your computer like your desktop as a hypertext file (which will be the default option). (I'm on a mac btw.)
Then go to the file on your computer and open it- it may unzip automatically or un-zip it. That's the file and it works. Just replace the existing file in your /ndxz-studio/site/plugin/ folder.

I hope this helps.

wiesedruck / 2011-03-28 21:54:13   

argh and Ivy Girl-

The link does work but you have to control (or command) click on it.
Chose 'save link as...' and save it to somewhere on your computer like your desktop as a hypertext file (which will be the default option). (I'm on a mac btw.)
Then go to the file on your computer and open it- it may unzip automatically or un-zip it. That's the file and it works. Just replace the existing file in your /ndxz-studio/site/plugin/ folder.

I hope this helps.

wiesedruck / 2011-03-28 21:56:29   

oops- sorry for the repost.

IvyGirl / 2011-04-04 11:03:31   

Thanks wiesedruck. I have the file, now I'm waiting for my server to upload it and see how it works.

IvyGirl / 2011-04-04 11:35:29   

I was able to replace with the new file, but now the arrows for the thickbox slideshow are missing. Does anyone know what to add or change to fix this problem? Thanks a lot.

http://www.ivstudios.com/index.php?/recent/recent-work/

IvyGirl / 2011-04-04 11:53:57   

And the initial problem of the caption being cut off in the middle was not fixed by replacement file.

argh / 2011-05-09 13:47:30   

hi wiesedruck, thanks for your help! i can actually download it but when i open it this is what i get:

PK|¡·8™É®ôÜ…exhibit.thickbox.phpUT ì7Hl 7HUxõuUmoÚHþŒÅÔ‡º@$ªtÒ…@Ž$nš*À è]O!Bk{7µw}»KWå¿wÖ/ ¡‰ÒDÞ™gÞžyéÉigÀ#h¼ YÄ dv5÷H³ lÃMƒŒ%„±À€Ï Ð `ZMùÀBÒì9N·ÕrZ0yðÝ—Ç>¼MìsÃ¥€Hª”hÈ “Zs?aàoᚯbƒ@E_þ[3µ=A ×J3´ÀÞ3¥­›£Î¡}Òµ‰¥‚¿©þNQßÅà]ÀÔé:1"%S01ƒLÑîSµ…6ø ôZ1«Ô (~q¡ ÁB§Î61Çlo—Öäú@îòŒ:¦,«c½=ð]¥JÑmã Ô6w-­¨,Ü{ª ‘4äb5

argh / 2011-05-09 13:49:05   


etc etc

opening the file with dreamweaver displays only "PK" and nothing else. what am i doing wrong? (i´m on a mac too)

blameme / 2011-05-09 15:04:26   

hey argh, make sure it's unzipped, and try to open it with TextEdit

argh / 2011-05-09 17:28:58   

hey blameme, thank you for your quick answer. unfortunately thats exactly what happens when i open it with text edit. i also tried open office, its the same problem.

argh / 2011-05-09 17:32:41   

as it seems to work with all of you except me could anyone please just copy and paste the correct code in this forum? that would be great!!

blameme / 2011-05-10 04:02:18   

Note: never try to edit this stuff with word processing applications like Word or Open Office, it will give you headaches that make your brain explode.

On mac I recommend Fraise as a simple free editor that just works.

Here you go:

  1. <?php if defined'SITE' exit'No direct script access allowed'

/**
* Thickbox
*
* Exhbition format
* Made possible by Lightbox and Jquery, of course
*
* @version 1.0
* @author Vaska
*/

// defaults from the general libary - be sure these are installed
$exhibit['lib_css'] = 'jquery.thickbox.css';
$exhibit['lib_js'] = array('jquery.thickbox.js');
$exhibit['dyn_js'] = "var loadingAnim = '" . BASEURL . "/';";
$exhibit['dyn_css'] = dynamicCSS();
$exhibit['exhibit'] = createExhibit();

function createExhibit()
{
    $OBJ =& get_instance();
    global $rs;
    
    $pages = $OBJ->db->fetchArray("SELECT *
        FROM ".PX."media, ".PX."objects_prefs
        WHERE media_ref_id = '$rs[id]'
        AND obj_ref_type = 'exhibit'
        AND obj_ref_type = media_obj_type
        ORDER BY media_order ASC, media_id ASC");
        
    // ** DON'T FORGET THE TEXT ** //
    $s = $rs['content'];
    $s .= "n<div class='cl'><!-- --></div>n";

    if (!$pages) return $s;
    
    foreach ($pages as $height)
    {
        $height = getimagesize(DIRNAME . GIMGS . "/th-$height[media_file]");
        
        $find_smallest_height[] = $height[1];
    }
    
    sort($find_smallest_height, SORT_NUMERIC);
    rsort($find_smallest_height);
    $lowest = array_pop($find_smallest_height);
    
    $i = 1; $a = '';
    
    // people will probably want to customize this up
    foreach ($pages as $go)
    {
        $title         = ($go['media_title'] == '') ? '' : $go['media_title'];
        $title         .= ($go['media_caption'] == '') ? ' ' : ' ' . $go['media_caption'];
        
        $a .= "n<a href='" . BASEURL . GIMGS . "/$go[media_file]' title="$title" class='thickbox' rel='gallery-plants'><img src='" . BASEURL . GIMGS . "/th-$go[media_file]' alt="$go[media_caption]" height='$lowest' /></a>n";
        
        $i++;
    }
    
    // images
    $s .= "<div id='img-container'>n";
    $s .= $a;
    $s .= "</div>n";
        
    return $s;
}

function dynamicCSS()
{
    return "a.thickbox { border: none; }na.thickbox img { border: 3px solid #fff; margin: 0 6px 9px 0; }";
}

?>

blameme / 2011-05-10 04:03:21   

Oops, but there it is.

argh / 2011-05-10 07:16:40   

hey blameme, thanks so much!!!

there is still a problem: when i now look at my thickbox gallery i get this error message:
Parse error: syntax error, unexpected T_STRING in /mnt/webc/33/36/52706236/htdocs/ndxz-studio/site/plugin/exhibit.thickbox.php on line 55

this is what i have in line 55 after pasting your code in:
$title         = ($go['media_title'] == '') ? '' : $go['media_title'];

anything wrong with that line? could you please help me once more?

This thread has been closed, thank you.