PDA


View Full Version : displaying Post info


Lionel
04-14-2005, 03:46 AM
I tweaked an existing hack so I could display a caption under thumb images, if any. I placed in posbit_attachmentthumbnail template: $post['caption']. It looks really nice.

I noticed that news.php uses the same template too. So in the $getnews select statement i added post.caption in there so it looks like

forumid, post.postid, post.caption AS caption, pagetext, allowsmilie

and down in the // attachments section, I did


if ($counter==1)
{
$post['caption'] = '';
$post['caption'] = $news['caption'];
$attachment = '<a href="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '" target="_blank"><img border="0" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '&amp;stc=1&amp;thumb=1" /></a>';
}
else


The caption is not displaying. Please, what am I missing in there? How do I get that caption post element? Is it possible? Don't know if it needs the left join thing or what?

First image is how it looks in showthread.
Second image is front page with problem

Brian
04-14-2005, 12:44 PM
Try adding the code right below the // News Attachments line.

Lionel
04-14-2005, 02:40 PM
Still nothing displays

Brian
04-14-2005, 04:38 PM
Try something like this then:
$attachment = '<a href="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '" target="_blank"><img border="0" src="' . $vboptions['bburl'] . '/attachment.php?' . $session['sessionurl'] . 'attachmentid=' . $news['attachmentid'] . '&amp;stc=1&amp;thumb=1" /></a><br />' . $post['caption'];

Lionel
04-14-2005, 10:19 PM
Works perfect. And show it only for first thumb too, as desired. Thanks.