The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Thread Thumbnail Details »» | |||||||||||||||||||||||||
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:
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 /> </if> </td> </if> 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> __________________________________________________ ___ 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"> Code:
<if condition="($tt_displaythumbs) AND ($bbuserinfo['field5'] <> 'Off' OR $show['guest'])"> Show Your Support
|
Comments |
#162
|
||||
|
||||
3.6.8 .. installed . showed NO THUMBNAIL in the forums i defined in array .. and SQL error while going for New post .. so didnt have any option .. uninstalled but i like this thingi..
|
#163
|
||||
|
||||
usmansabir,
This mod/hack is priceless if you have an art forum. This hack has worked for me from vB3.6.5 through vB3.7.2, but, since vB3.6.8 came out you have to tweak the search.php so new post search works (see page 8, post #112, 114). Also, don't forget you need to turn on thread thumb creation (see page 9, post #121). If you have linked and/or full image (non-thumbnailed) images in a new thread's 1st post then a thumbnail is NOT available, thusly, it won't show up as a thumbnail, regardless. |
#164
|
|||
|
|||
@theOZer: have you found a way to make this work also in tag search?
|
#165
|
||||
|
||||
FYI: This mod and the search.php tweak work in vB3.7.2.
We're fortunate, once again, this works by bastardizing search.php. Yes, there has got to be a better way. No, Defkalion, I have not worked with adding this to Tags. I'm not a coder but this does intrique me. I would like to, first and foremost, use vB's hooks in the search.php, to "properly" incorporate ThreadThumbnails into New Posts search. Then, maybe, after learning how to do that I can also do this in Tags; it may just fall all into place. There's a vB SDK (I believe) that I can download, read, then take it from there. We will see. P.S. NeverBored also offers good help (page 8 - 10) on how to display 'full page' threads. |
#166
|
|||
|
|||
All I did when I upgraded to 3.7.2, was upload the old modified search.php file (after I found that the new 3.7.2 version was generating an SQL error), did you modify your new 3.7.2 version, or just replace it with the old modified one, if you modified it, I'd like to see what you did, as I think I may be missing some features by using the old modified one.
Also, has anyone got it to work when searching for individual posts and not threads? As my main section is photo based and it would look a lot better. |
#167
|
||||
|
||||
rolfw1,
You HAVE TO MODIFY the vB3.7.2 search.php, adding the Thread Thumbnail 'hook' (see page 8, post #112, 114). I believe that this mod, as it's currently written, only checks for an image attachment on the 1st post of a thread. |
#168
|
||||
|
||||
Yay! I got Thread Thumbnails to so show up in a TAG Search!!!
I created a Thread Thumbnail Tag Search plugin, copying thread-thumbnail-plugins.xml then tweaking it. I had to make minor changes to Tag.php. I had to add an additonal If statement to the threadbit template to get Tag search thumbnails to display. I need to put together a 'How I Did This' write-up. I'll get this done today. P.S. I plan to post my write-up, soon. |
#169
|
|||
|
|||
COOL!!!! Can't wait to implement this!
|
#170
|
||||
|
||||
Adding Thread Thumbnails to Tag Search
Salute to Jason Merchant the original coder of this excellent Thread Thumbnails mod. Salute to vB.org for hosting this mod's thread. This is a 'How I Did It.' I hope this is ethically correct that I can post this tweak, seeing how I stole the plugin from Jason and tags.php needs to be modified. I have this up-and-running on my forum; it works for me, okay? tags.php needs to be slightly tweaked to make this all happen. You will need to install a plugin. You will need to modify your threadbit template(s). [Note: Before changing your current tags.php file make a backup copy named tags_original.php, for example.] A) Tweak the tags.php file: Change tags.php >>Find: $hook_query_fields = $hook_query_joins = ''; ($hook = vBulletinHook::fetch_hook('tags_list_query_data')) ? eval($hook) : false; >>Change the 1st line to: $hook_query_fields = $hook_query_joins = $hook_query_where = ''; ($hook = vBulletinHook::fetch_hook('tags_list_query_data')) ? eval($hook) : false; At the bottom of the following select statement - >>Find: $hook_query_joins WHERE thread.threadid IN (" . implode(',', $threadids) . ") >>Change the 2nd line to: $hook_query_joins WHERE thread.threadid IN (" . implode(',', $threadids) . ") $hook_query_where B1) Create the plugin .xml file: Copy the following xml code, pasting it into Wordpad or Notepad. Save the file as a .xml. For example, I named mine: thread-thumbnail-plugins-tags.xml Code:
<?xml version="1.0" encoding="ISO-8859-1"?> <plugins> <plugin active="1" executionorder="5" product="vbulletin"> <title>Thread Thumbnail - Tag Search</title> <hookname>tags_list_query_data</hookname> <phpcode><![CDATA[$tt_displaythumbs_tags = true; $hook_query_fields .= ", attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid "; $hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) "; $hook_query_where .= "GROUP BY thread.threadid ";]]></phpcode> </plugin> </plugins> In Admin Control Panel > Plugins & Products > Download/Upload Plugins > Import Plugin Definitions XML File window, Import the .xml file you just created. C) threadbit template changes: Here's my New & Improved threadbit template change to thread thumbnail both regular searches and Tag searches. Your current TT code may differ from mine, for sure. Code:
<!-- Thread Thumbnails --> <if condition="$show['threadicons']"> <td class="alt2" align="center" valign="middle"> <!-- TAG Search Thread Thumbnails --> <if condition="($tt_displaythumbs_tags)"> <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 /> <if condition="$show['threadicon']"> <img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" /> <else /> </if> </if> <else /> <!-- Thread Thumbnails in Forums & Search --> <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" /> <else /> </if> </if> </if> </td> </if> <!-- end of Thread Thumbnails --> Regards, theOZer |
#171
|
|||
|
|||
Aaarrrgh!! It works!!
I just have to figure out why it's leaving such a big space for the thumbs column now. :P Many thanks man. Any ideas for the thumbs column width? Edit: Don't worry about it, already fixed it, it was an extra </td> making the damage. It's working GREAT! Thankyou so much for your effort theOZer |
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|