Thumbnail of attachment in threadlist
#1
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............


Attached Files Thumbnail(s)
   
Reply
#2
ny 1?
Reply
#3
And what if threads contain multiple attachments ? Threadlist would be messed up i suppose
Reply
#4
only the first attachment is to be displayed.......
ny 1 plz
Reply
#5
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}
Reply
#6
thx 4 ur reply
IT WORKZ GR8
thankz again
Big Grin
Reply
#7
bump...
wow nice Smile
Hello, Welcome to MyBB Indonesia to get local support
My 'Simple' Unique Plugin here Smile
Reply
#8
Niceee.
Reply
#9
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!

Reply
#10
(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>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)