hi all
can any body provide the modification for thumbnail of attachment in threadlist in forum as seen in attachement.
thx for looking my request
if ny body knows plz help............
And what if threads contain multiple attachments ? Threadlist would be messed up i suppose
only the first attachment is to be displayed.......
ny 1 plz
Try this;
Open forumdisplay.php
Find
else
{
$attachment_count = '';
}
Add Below
// GET FIRST ATTACHMENT
$attachment_thumbnail = '';
if($attachment_count)
{
$query = $db->query("
SELECT a.thumbnail
FROM ".TABLE_PREFIX."attachments a
LEFT JOIN ".TABLE_PREFIX."posts p ON (p.pid=a.pid)
WHERE p.tid='{$thread['tid']}' AND a.filetype LIKE '%image%'
ORDER BY a.dateuploaded ASC
LIMIT 0,1
");
$thumbnail = $db->fetch_field($query, 'thumbnail');
if($thumbnail)
{
$attachment_thumbnail = "<div style=\"float:left\"><img src=\"./uploads/{$thumbnail}\" /></div>";
}
}
Then open
forumdisplay_thread template
Find
{$attachment_count}
<div>
Add after
{$attachment_thumbnail}
thx 4 ur reply
IT WORKZ GR8
thankz again
bump...
wow nice
This works really well on the image galleries on my nature photography forum... is there a way to make the resulting thumbnail a clickable link to the thread, just like the thread title?
Thanks!
(2011-04-24, 08:38 PM)Johnasc Wrote: [ -> ]This works really well on the image galleries on my nature photography forum... is there a way to make the resulting thumbnail a clickable link to the thread, just like the thread title?
Thanks!
Replace {$attachment_thumbnail} with the following;
<a href="{$thread['threadlink']}">{$attachment_thumbnail}</a>