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

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

Version: 3.5.0 Rating:
Released: 10-17-2005 Last Update: 10-21-2005 Installs: 108
Uses Plugins Template Edits
 
No support by the author.

The new version is available here.




This plugin was based on Thumbnail of Attachments on forum display by Dechevious(I hope its alright with you)

It is mostly the same converted to the new 3.5 hook. I also fixed the "If the attachment is not an image, a thumbnail will not be shown" problem.

Note: This plugin works in v3.68

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.

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

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
  #12  
Old 10-18-2005, 08:17 PM
jasonmerchant jasonmerchant is offline
 
Join Date: Jun 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trancetopia
Interesting and useful mod but i've found a couple of problems.

I had the modify the template change to this:

HTML Code:
<if condition="$show['threadicons']">
	<td class="alt2" align="center" valign="middle">
	<if condition="$show['threadicon']">
			<if condition="$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 />
					 <img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
			</if>
	</if>
</td>
</if>
Notice i've moved where the <td class="alt2" align="center" valign="middle"> to after the first condition instead of the second. Having the cell opened after the second condition badly messed up the table structure of the threadbit. I changed the close tag </td> to align with this change also. This happened for me anyway.

The second problem is that when this is activated for a forum, no threads show at all. Not sure why but suspect the query, not had chance to look any further as i'm in work.
Yes thats right, I hadn't really tested it on the default style last night. I've updated the themplate changes and moved the
Code:
<if condition="$show['threadicon']">
inside the else statement to prevent threads without a thread icon from not showing the thumbnail. Is that what you were referring to by "no threads show at all"? or is the entire thread info missing?
Reply With Quote
  #13  
Old 10-18-2005, 10:23 PM
trancetopia trancetopia is offline
 
Join Date: Feb 2005
Location: Wales, UK.
Posts: 161
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

All the threads are missing from the forum completely. The forum I tested this on had 18 threads in it and one with an attachment just to test things but after I specified the forum id in the plugin, this forum didn't show any of the 18 threads.
Reply With Quote
  #14  
Old 10-18-2005, 11:28 PM
jasonmerchant jasonmerchant is offline
 
Join Date: Jun 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hmm, I just installed it on a fresh default style and it worked. Have you tried it on the default style? I'm guessing this is a template problem, try reinstalling the template or post it here and I'll check it out.
Reply With Quote
  #15  
Old 10-19-2005, 12:59 AM
bpn bpn is offline
 
Join Date: Jul 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Floris
All threads listed show up with the nothumb image, none of them with attachment shows the thumbnail in the threadlist.
I have the same problem, and I just downloaded and installed your hack, so
I guess I have the latest update.
Reply With Quote
  #16  
Old 10-19-2005, 02:06 AM
bpn bpn is offline
 
Join Date: Jul 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bpn
I have the same problem, and I just downloaded and installed your hack, so
I guess I have the latest update.
I just found out that if I edit a thread and set it to show 'no icon', I do not get the "no thumb" pic. Now there's just an empty cell.
Reply With Quote
  #17  
Old 10-19-2005, 03:00 AM
nokturno nokturno is offline
 
Join Date: Sep 2005
Posts: 25
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thx!!!
Reply With Quote
  #18  
Old 10-19-2005, 03:01 AM
bpn bpn is offline
 
Join Date: Jul 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

For what it's worth I think the problem is that it dont is getting the attachmentid.
I did an output on this before the IF statements and got nothing on $thread['attachmentid'] but I did get the threadID on this $thread[threadid] placed on the same spot outside the IF statements
Reply With Quote
  #19  
Old 10-19-2005, 03:06 AM
jasonmerchant jasonmerchant is offline
 
Join Date: Jun 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bpn
I just found out that if I edit a thread and set it to show 'no icon', I do not get the "no thumb" pic. Now there's just an empty cell.
that is odd, have you tried making the template changes on a fresh default style? I'm almost certain it is a template error, where your template code is signifigantly different(my forum's style requires a slightly different code) or installation error. Please get back to me on your results.
Reply With Quote
  #20  
Old 10-19-2005, 03:09 AM
bpn bpn is offline
 
Join Date: Jul 2002
Posts: 23
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jasonmerchant
that is odd, have you tried making the template changes on a fresh default style? I'm almost certain it is a template error, where your template code is signifigantly different(my forum's style requires a slightly different code) or installation error. Please get back to me on your results.
I tried it on the default style and the one I'm currently using.
The deafult style is almost untouched, but I will try to install a fresh version now to see if it helps
Reply With Quote
  #21  
Old 10-19-2005, 03:10 AM
jasonmerchant jasonmerchant is offline
 
Join Date: Jun 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bpn
For what it's worth I think the problem is that it dont is getting the attachmentid.
I did an output on this before the IF statements and got nothing on $thread['attachmentid'] but I did get the threadID on this $thread[threadid] placed on the same spot outside the IF statements
sorry, missed the second page... it looks as if you don't have the latest plugin code.
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 07:37 PM.


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.04710 seconds
  • Memory Usage 2,319KB
  • 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_html
  • (6)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
  • (3)pagenav_pagelink
  • (1)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