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:
HTML:
<if condition="$show['threadicons']">
<td class="alt2">
<if condition="$show['threadicon']">
<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
<else />
</if>
</td>
</if>
Replace With:
Code:
HTML:
<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.