Back to vBulletin 3.6 Add-ons

Thread Thumbnail
Mod Version: 1.1, by jasonmerchant

This modification is in the archives.
vB Version: 3.6.8 Rating: (21 votes - 4.81 average) Installs: 209
Released: 21 Sep 2007 Last Update: 21 Sep 2007 Downloads: 1423
Not Supported Uses Plugins Template Edits  

This plugin is the newest version of the Thread Thumbnail plugin

This plugin will display the first attachment as a thumbnail on forumdisplay.php

New Features:
  • If there are attachments that are not images, it will skip them and go to the first image attachment.
  • Optional - you can now display thumbnails on search results.


Installation:

In your AdminCP, go to Plugin System, Download/Upload Plugins and import the xml document.

Be sure to change the forum ids in the $thumbsforums array to the forum ids you want to enable thumbnails in.

The plugin comes with the Search Thumbnails enabled. If you do not want to have thumbnails show up in the search results, make sure you deactivate it.

If you would like thumbnails to display in the search results, you will need to replace your search.php page with the one in the zip file. Unfortunately vBulletin forgot to include a hook variable where it is necessary for this to work. I have added 1 line to search.php with the hook variable. There is no way around this until vbulletin adds it themselves.

Next you will need to modify your threadbit template:

Find:
Code:
<if condition="$show['threadicons']">
	<td class="alt2">
		<if condition="$show['threadicon']">
			<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
		<else />
			&nbsp;
		</if>
	</td>
</if>
Replace With:
Code:
<if condition="$show['threadicons']">
	<td class="alt2" align="center" valign="middle">
			<if condition="$tt_displaythumbs">
				<if condition="($thread['attachmentid']) AND ($thread['thumbsize'])">
			     	<a href="showthread.php?$session[sessionurl]t=$thread[threadid]">
			          	<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" alt="" border="0" />
			        </a>
			     <else />
			        <img src="$stylevar[imgdir_misc]/nothumb.jpg" alt="" border="0" />
			     </if>
			<else />
				<if condition="$show['threadicon']">
			     <img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
				 </if>
			</if>
	</td>
</if>
You will also need to upload an image to display if there are no image attachments here: $stylevar[imgdir_misc]/nothumb.jpg(ex: http://www.mysite.com/forums/images/misc/nothumb.jpg). I've made a simple one you can use or you can make your own. By default thumbnails are confined in a 100x100 px area, I found that it looks good to make the "no image" image about 100x83 px.

_____________________________________________________

Add-ons (Optional)

UserCP option to turn the thumbnails on/off on a per user basis

Go into your admincp and click User Profile Fields->Add New User Profile Field.

Select "single selection radio buttons", click continue.

For title put "Thread Thumbnails", for description put "This will allow you to turn the thumbnails of threads on and off."

For options, enter "On" and "Off".

Skip down to Display Page and choose "Options: Thread Viewing".

In your threadbit template(assuming you already applied the template changes above):

Find:
Code:
<if condition="$tt_displaythumbs">
Replace with:
Code:
<if condition="($tt_displaythumbs) AND ($bbuserinfo['field5'] <> 'Off' OR $show['guest'])">
You need to replace field5 with the field name of the profile field you created earlier.

Download

This modification is archived, downloads are still allowed.

File Type: %1$s Thread_Thumbnail_v1-1.zip (32.3 KB, 1497 downloads)

Screenshots

Click image for larger version
Name:	attachment.jpg
Views:	5527
Size:	36.5 KB
ID:	70123  

Similar Mods

Thread Thumbnail vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024