Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.6 > vBulletin 3.6 Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Thread Thumbnail Details »»
Thread Thumbnail
Version: 1.1, by jasonmerchant jasonmerchant is offline
Developer Last Online: Jun 2009 Show Printable Version Email this Page

Category: Forum Display Enhancements - Version: 3.6.8 Rating:
Released: 09-20-2007 Last Update: 09-20-2007 Installs: 209
Uses Plugins Template Edits
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #112  
Old 04-02-2008, 03:55 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

NeverBored,
I did a file compare using TOAD: vB369 search.php versus Thread Thumbnails search.php.
There's very little difference between these two search.phps.
There's quite a difference between vB370RC2 search.php versus Thread Thumbnails search.php, though.
I put together a cluge-bag screen capture of the search.php differences, put into a Word document, that I can PM to you.
~OZ
Reply With Quote
  #113  
Old 04-02-2008, 05:11 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you add JasonMerchant's code, a comment line and code line, to the vB370RC2 search.php it APPEARS to work; now shows the thumbnails when doing a New Posts search.
Code:
	// do data query
	if (!empty($itemids))
	{
		$ids = implode(', ', array_keys($itemids));
		$dataQuery .= '(' . $ids . ')';
		//edited by jason
		$dataQuery .= " " . $hook_query_where;		$items = $db->query_read_slave($dataQuery);
		$itemidname = iif($search['showposts'], 'postid', 'threadid');

		$dotthreads = fetch_dot_threads_array($ids);
	}
[Note: I bolded Jason's code for clarity.]

Give this a try. This truly is a wonderful hack and it's a priceless addition to any art forum that has people posting their art work.
~OZ
Reply With Quote
  #114  
Old 04-02-2008, 07:00 PM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Great, that got the thumbnails working for search, thanks.

Though, a small problem, it displays thumbnails (the no thumbnail available image) for threads not in the specified forums. It did this using the search.php included in the download too, so I don't know if this is how it works or just a bug using it as is on 3.7.
Reply With Quote
  #115  
Old 04-02-2008, 07:19 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

True enough. It appears any 'new posts,' be it from whichever forum, either shows the 'No Image' icon or, if there's an attachment, it shows the thumbnail.
If the forum itself is not included in the TT plugin's list of forums to display,
example, $tt_thumbsforums = array(4, 5, 17, 46, 50, 53);
then that specific forum's threads list do not then show thumbnails when viewed.
This 'feature'/not-necessarily-a-bug appears to have been 'in place' since day one the hack has been around. (I also see this glitch occurs in vB3.6.x.)
Reply With Quote
  #116  
Old 04-04-2008, 04:29 AM
lauxanh lauxanh is offline
 
Join Date: Mar 2006
Posts: 59
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I got mysql error after upgrade to 3.6.9 when search for thread started by member.
Quote:
Database error in vBulletin 3.6.9:
Invalid SQL:
SELECT post.pagetext AS preview,
thread.threadid, thread.threadid AS postid, thread.title AS threadtitle, thread.iconid AS threadiconid, thread.dateline, thread.forumid,
thread.replycount, IF(thread.views=0, thread.replycount+1, thread.views) as views, thread.sticky,
thread.pollid, thread.open, thread.lastpost AS postdateline, thread.visible, thread.hiddencount, thread.deletedcount,
thread.lastpost, thread.lastposter, thread.lastpostid, thread.attach, thread.postusername, thread.forumid,

deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason,
user.userid AS postuserid
, NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed

, attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid
FROM thread AS thread
LEFT JOIN user AS user ON(user.userid = thread.postuserid)
LEFT JOIN deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')

LEFT JOIN subscribethread AS subscribethread
ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = 1 AND canview = 1)
LEFT JOIN post AS post ON(post.postid = thread.firstpostid)

LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png'))
WHERE thread.threadid IN
(31818, 31485, 26032, 30791, 30777, 12626, 31813, 17504, 30916, 14352, 30784, 30778, 30802, 30768, 31388, 28247, 30765, 31152, 15399, 30806, 27583, 15294, 20513, 30131, 30793);
MySQL Error : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
Error Number : 1140
Date : Friday, April 4th 2008 @ 12:26:57 AM
Script : http://www.xxxxxxxxxx/search.php?searchid=222763
Referrer : http://www.xxxxxxxxxx/member.php?u=67920
Classname : vb_database
Any idea how to fix it?
Reply With Quote
  #117  
Old 04-04-2008, 01:45 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You need to turn off the Thread Thumbnail - Search plugin.
-OR-
Add Jason's code to the vB369 search.php, as mentioned in my Post #112, above.
~OZ
Reply With Quote
  #118  
Old 04-06-2008, 09:17 AM
winkm winkm is offline
 
Join Date: Mar 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi, I installed this mod which is great, but it only shows "No Thumbnail Available" also if there is an image attachment. I'm running 3.6.8 patch level 2.

See:
http://www.inoudeansichten.nl/zoekpl...splay.php?f=40

I used: Thread_Thumbnail_v1-1.zip
- imported the XML
- activated plugin
- updated threadbit

Any suggestions how to solve this ?
thanks!
Reply With Quote
  #119  
Old 04-06-2008, 01:46 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'm looking at your web site...

Are you dead certain that you've updated threadbits correctly? Most likely, yes.

Did you update the Thread Thumbnail plugin, adding your test forums ID number (bolded below)?

http://www.inoudeansichten.nl/zoekpl...display.php?f=40

(I'd also try adding forum ID 42 (the main forum), to test it out.)

In the Thread Thumbnail plugin, is forum 40 been added?:
example, $tt_thumbsforums = array(40, 42);

Did you set up a member option User Profile field for Thumbnails On/Off? If not then do NOT include the code to check for the user profile field in your threadbits. (I have this option added.)

Have you replaced your vB368PL2 search.php with Jason's search.php? (It works for vB368 but vB369 a/o vB370x requires modding the search.php adding Jason's code. See my post # 112 , above, concerning this.)

Jason's TT works and has always worked for me. Good luck getting this to work. It's a great hack.

[Note: only an image posted as an attachment will/should show as a thumbnail pic; the test image INSERTS, e.g., your test3 post, won't show as thumbnails.]

Later, ~OZ
Reply With Quote
  #120  
Old 04-13-2008, 08:31 AM
winkm winkm is offline
 
Join Date: Mar 2008
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

OZ, thanks for your reply !

I upgraded my vBulletin to 3.6.9
- installed xml file
- updated threadsbit
- changed forum to #40
- update search.php (incl. your 112 post)
- plugins are both activated

but ... attachments still not displayed ....

any other suggestions I can try ???

thanks!
Reply With Quote
  #121  
Old 04-13-2008, 05:42 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

winkm,
Joined your forum. Couldn't post in TEST forum to see if my hunch is right, but...
the test threads' pictures are full sized. It appears that the images were inserted into the post code, not added as attachments through Manage Attachment at the bottom of an Advanced screen post.
Images inserted directly into the code/the post don't have thumbnails; they're shown full sized, with no need to click on them to see them larger.
That's my guess.
~OZ
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:08 AM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05043 seconds
  • Memory Usage 2,317KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (5)bbcode_code
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete