PDA

View Full Version : Thread Thumbnails



admin
27-09-2009, 08:42 PM
Thread Thumbnails
--------------------------------------
Created By: Null Parameter

This mod is tested with 3.8.1, but may work with other versions.

Please leave any comments, suggestions or bugs.

Description

This mod allows a user, when creating or editing a thread, to specify a Thumbnail image to be used for display next to the thread in the Thread Listing. There are other mods that do this with Attachments, but I wanted to be able to do it with any image.

With this mod you can define a set of forums that have thumbnails enabled, then in those forums whenever a user creates or edits their thread (they must edit the first post in the thread), they can define the thumbnail image.

This image is then shown in the Forum Display, in place of the Thread Icon.
The image also appears in Tag Search, and I can add it to the regular Search if somebody requests it. And possibly have options for displaying in each area.

Forum Display:
http://img.photo.zing.vn/file_uploads/gallery/sources/2009/09/27/10/45601254065515.jpg

Other options include:

Showing Thumbnails for sticky threads
Width to use for thumbnails
URL of an image to use if no thumbnail is defined
Here is an example image:
http://img.photo.zing.vn/file_uploads/gallery/sources/2009/09/27/10/73821254065484.jpg
(http://www.vbulletin.org/forum/attachment.php?attachmentid=99736)
Width to use for No Thumbnail Image

ACP Options:
http://img.photo.zing.vn/file_uploads/gallery/sources/2009/09/27/10/95551254065474.jpg

Installation

Install the Product XML File.

Do the following template edits: editpost

Find "<!-- / subject field -->"
Place this underneath it:


<if condition="$isfirstpost AND $showthumbnailedit">
<if condition="$vbulletin->GPC[advanced]">
<input type="hidden" name="desc_adv_thumb" value="1" />
</if>
<table cellpadding="0" cellspacing="0" border="0" style="margin-bottom:$stylevar[formspacer]px">
<tr>
<td class="smallfont" colspan="3">Thumbnail URL:</td>
</tr>
<tr>
<td><input type="text" class="bginput" name="thumbnailurl" value="$threadinfo[thumbnailurl]" size="50" maxlength="250" tabindex="1.5" title="" /></td>
</tr>
</table>
</if>


newthread

Find "<!-- / subject field -->"
Place this underneath



<if condition="$showthumbnailedit"><table cellpadding="0" cellspacing="0" border="0" style="margin-bottom:$stylevar[formspacer]px"><tr><td class="smallfont" colspan="3">Thumbnail URL:</td></tr><tr><td><input type="text" class="bginput" name="thumbnailurl" value="$threadinfo[thumbnailurl]" size="50" maxlength="250" tabindex="1.5" title="" /></td></tr></table></if>


threadbit

Find



<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

<if condition="$show[threadicons]">
<td class="alt2" align="center" valign="middle">
<if condition="$thread[thumbnaildisplay] AND !$thread[sticky]">
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]">
<img src="$thread[thumbnailurl]" alt="" border="0" width="$thread[thumbnailwidth]"/>
</a>
<else />
<if condition="$show[threadicon]">
<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
</if>
</if>
</td>
</if>

Demo (http://xforgery.com/forum/forumdisplay.php?f=83)

Possible Future Features (With Request)

Display Thumbnail in Search
Options for Display Locations
Additional column instead of replacing Thread Icon
Displaying Thumbnail within thread
Edit thumbnail through Thread Edit
Thumbnail Preview in Edit Window
Automatic Template Edits

Fixes
None.

c0n.g4.2009
13-10-2009, 10:40 AM
Bác ơi mod xong hết rồi mà sao nó ko hiển thị vậy.
Kiểm tra giúp em cái lỗi này cái
http://14vn.net/diendan/forumdisplay.php?f=4

hau_ooo
19-10-2009, 07:24 AM
Bác ơi mod xong hết rồi mà sao nó ko hiển thị vậy.
Kiểm tra giúp em cái lỗi này cái
http://14vn.net/diendan/forumdisplay.php?f=4


Bạn vào Admin CP --> Vb Options tìm đến cái product đó xem đã enable chưa

khuongvn
19-10-2009, 09:30 PM
ai có thê chỉ dậy rõ ko a em impot mod song sao ko hiện