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

Trana:

You can edit this section in the postbit timeplate:

Code:
<if condition="$show['thumbnailattachment']">
	<fieldset class="fieldset">
		<legend>$vbphrase[attached_thumbnails]</legend>
		<div style="padding:$stylevar[formspacer]px">
			$post[thumbnailattachments]
		</div>
	</fieldset>
</if>
		
<if condition="$show['imageattachment']">
	<fieldset class="fieldset">
		<legend>$vbphrase[attached_images]</legend>
		<div style="padding:$stylevar[formspacer]px">
			$post[imageattachments]
		</div>
	</fieldset>
</if>


Aery:

You can edit the plugin through the control panel, there is no need to mess around in the xml file.

On the following line you place the forum ids of the forums that will have thumbnails. So if you want to enable thumbnails on forums 6, 11, and 25, the code would look like:

Code:
$tt_thumbsforums = array(6, 11, 25);
Reply With Quote
  #183  
Old 08-22-2007, 01:35 PM
Aery Aery is offline
 
Join Date: Mar 2007
Posts: 7
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you very much.
My dumb about editing XML file
Reply With Quote
  #184  
Old 08-24-2007, 02:57 PM
theOZer's Avatar
theOZer theOZer is offline
 
Join Date: Mar 2007
Location: Colorado, USA
Posts: 212
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

A direct question to jasonmerchant:
Why is OR $show['guest'] part of the if tag that checks for the user chosen thumbnails On or Off option?
(<if condition="($tt_displaythumbs) AND ($bbuserinfo['field5'] <> 'Off' OR $show['guest'])">)
Why is it "necessary" to also check $show['quest'] in the if tag? The issue is whether or not the thread option is On or Off, right(??).
Reply With Quote
  #185  
Old 08-30-2007, 03:05 AM
Trana Trana is offline
 
Join Date: Apr 2005
Posts: 604
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jasonmerchant View Post
Trana:

You can edit this section in the postbit timeplate:

Code:
<if condition="$show['thumbnailattachment']">
	<fieldset class="fieldset">
		<legend>$vbphrase[attached_thumbnails]</legend>
		<div style="padding:$stylevar[formspacer]px">
			$post[thumbnailattachments]
		</div>
	</fieldset>
</if>
		
<if condition="$show['imageattachment']">
	<fieldset class="fieldset">
		<legend>$vbphrase[attached_images]</legend>
		<div style="padding:$stylevar[formspacer]px">
			$post[imageattachments]
		</div>
	</fieldset>
</if>
Sorry, I'm not following what you want me to do. Can you explain a little further?
Reply With Quote
  #186  
Old 09-18-2007, 04:27 PM
nnjj.net nnjj.net is offline
 
Join Date: Dec 2002
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

is there any update for 3.6.8?
Reply With Quote
  #187  
Old 09-18-2007, 05:03 PM
jasonmerchant jasonmerchant is offline
 
Join Date: Jun 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

theOzer:

The $show['guest'] in the if statement turns thumbnails on for all guests. Guests don't have profile options, so they can not choose.

nnjj.net:

This plugin works in 3.6.8, maybe a moderator can move this plugin to the 3.6.8 forum?

Trana:

I believe you said that you don't want to display thumbnails in posts with this plugin, correct?

All you need to do is replace the content of the first if statement with the second one. ie:

Replace:
Code:
<legend>$vbphrase[attached_thumbnails]</legend>
		<div style="padding:$stylevar[formspacer]px">
			$post[thumbnailattachments]
		</div>
With:
Code:
<legend>$vbphrase[attached_images]</legend>
		<div style="padding:$stylevar[formspacer]px">
			$post[imageattachments]
		</div>
Reply With Quote
  #188  
Old 09-21-2007, 03:19 AM
casa casa is offline
 
Join Date: Apr 2007
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PLEASE - does anyone know how to modify this line to make it show the LAST attachment:
<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" alt="" border="0" />
Reply With Quote
  #189  
Old 09-21-2007, 04:24 AM
jasonmerchant jasonmerchant is offline
 
Join Date: Jun 2005
Posts: 35
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Casa:

I have not tested it yet, but you should be able to just change the MIN sql function to MAX. ie:

Replace the following in the plugin:

Code:
$hook_query_fields .= ", attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid ";

With:
Code:
$hook_query_fields .= ", attachment.thumbnail_filesize AS thumbsize , MAX(attachment.attachmentid) AS attachmentid ";
Reply With Quote
  #190  
Old 09-21-2007, 04:46 AM
casa casa is offline
 
Join Date: Apr 2007
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by jasonmerchant View Post
Casa:

I have not tested it yet, but you should be able to just change the MIN sql function to MAX. ie:
[/CODE]

Jason
You rock, that worked.
PM me if you are interested in other coding work.

thanks
Reply With Quote
  #191  
Old 09-21-2007, 07:30 PM
nnjj.net nnjj.net is offline
 
Join Date: Dec 2002
Posts: 342
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Be sure to change the forum ids in the $thumbsforums array to the forum ids you want to enable thumbnails in

where???
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 01:02 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.05331 seconds
  • Memory Usage 2,320KB
  • 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
  • (11)bbcode_code
  • (2)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