MyBB Community Forums
Thumbnail of attachment in threadlist - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Requests (https://community.mybb.com/forum-65.html)
+---- Thread: Thumbnail of attachment in threadlist (/thread-47562.html)

Pages: 1 2 3 4 5 6 7 8


Thumbnail of attachment in threadlist - hexad3cimal - 2009-04-02

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............


RE: Thumbnail of attachment in threadlist - hexad3cimal - 2009-04-04

ny 1?


RE: Thumbnail of attachment in threadlist - LeX- - 2009-04-04

And what if threads contain multiple attachments ? Threadlist would be messed up i suppose


RE: Thumbnail of attachment in threadlist - hexad3cimal - 2009-04-04

only the first attachment is to be displayed.......
ny 1 plz


RE: Thumbnail of attachment in threadlist - LeX- - 2009-04-04

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}



RE: Thumbnail of attachment in threadlist - hexad3cimal - 2009-04-06

thx 4 ur reply
IT WORKZ GR8
thankz again
Big Grin


RE: Thumbnail of attachment in threadlist - FBI - 2009-11-12

bump...
wow nice Smile


RE: Thumbnail of attachment in threadlist - Aaron - 2009-11-12

Niceee.


RE: Thumbnail of attachment in threadlist - Johnasc - 2011-04-24

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!




RE: Thumbnail of attachment in threadlist - Yaldaram - 2011-04-25

(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>