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
  #142  
Old 05-12-2008, 12:04 AM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

As far as tags, I think another plugin needs to be created in addition to adding the code to tags.php. I tried looking at the file myself, but I just have no idea where it'd go. It would seem it'd be a pretty easy thing to do for someone that knows what they're doing to adapt it to tags. It's too bad someone with the knowledge hasn't taken over this mod for 3.7, since the author is gone.
Reply With Quote
  #143  
Old 05-12-2008, 05:59 AM
Defkalion Defkalion is offline
 
Join Date: Jan 2007
Location: Athens, Greece
Posts: 201
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well this mod is working fine in my 3.7 installation, and with the addition of that little piece of code I also get the thumbnails in search. But as you say, we just need someone that know what they're doing to tell us where to put this line of code to TAGS.PHP so that we can have thumbs there too.

Anyone?
Reply With Quote
  #144  
Old 05-13-2008, 05:56 AM
viper007 viper007 is offline
 
Join Date: Dec 2007
Posts: 147
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

cant see the attachemnt as thumbnail
Reply With Quote
  #145  
Old 05-13-2008, 06:49 PM
mwink mwink is offline
 
Join Date: Mar 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NeverBored View Post
Copy and paste the postbit_attachmentimage template contents into the postbit_attachmentthumbnail template (delete the current contents in postbit_attachmentthumbnail)

Make sure you have thumbnail creation on. This will display the thumbnails for use with this hack, and in the thread will display the fullsize image (what you would normally see if you clicked on the thumbnail of an attached image), which is what I understood you were asking to accomplish...

It's a quick fix and shouldn't pose any problems other than the fact potentially a lot of thumbnails are created that aren't used if you have a lot of image uploads.
Hi neverbored,

thanks for explaining this. This is what happens:

if we have thumbnail creation on, when we post a message with attachment, it shows a (correct) thumbnail before the post. Inside the post however, it still shows a thumbnail instead of the full size photo.

When, after creating this post, I switch thumbnail creation off again, than the situation is how we would like to have it: thumbnail before the post and fullsize inside..

Of course we can not have thumbnail creation switched to off..

Any suggestion?

Thanks a lot!!
Reply With Quote
  #146  
Old 05-13-2008, 08:16 PM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mwink View Post
Hi neverbored,

thanks for explaining this. This is what happens:

if we have thumbnail creation on, when we post a message with attachment, it shows a (correct) thumbnail before the post. Inside the post however, it still shows a thumbnail instead of the full size photo.

When, after creating this post, I switch thumbnail creation off again, than the situation is how we would like to have it: thumbnail before the post and fullsize inside..

Of course we can not have thumbnail creation switched to off..

Any suggestion?

Thanks a lot!!
If you do what I wrote, you'll have what you want.

Copy and paste the postbit_attachmentimage template contents into the postbit_attachmentthumbnail template (overwrite the current postbit_attachmentthumbnail contents). And leave thumbnail creation on.
Reply With Quote
  #147  
Old 05-20-2008, 11:34 PM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a great mod! Love it. One question though, would it be possible to set a nothumb image per forum?

Thanks in advance...
Reply With Quote
  #148  
Old 05-21-2008, 01:10 AM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by nando99 View Post
This is a great mod! Love it. One question though, would it be possible to set a nothumb image per forum?

Thanks in advance...
Easy. Replace the nothumb image with this, <img src="$stylevar[imgdir_misc]/nothumb$thread[forumid].jpg" alt="" border="0" />

Then save your seperate nothumb images with the forum id in the file name.
Reply With Quote
  #149  
Old 05-21-2008, 01:23 AM
nando99 nando99 is offline
 
Join Date: Dec 2005
Location: South Florida
Posts: 218
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NeverBored View Post
Easy. Replace the nothumb image with this, <img src="$stylevar[imgdir_misc]/nothumb$thread[forumid].jpg" alt="" border="0" />

Then save your seperate nothumb images with the forum id in the file name.
Well then - that sounds easy enough... lol thanks
Reply With Quote
  #150  
Old 05-22-2008, 07:21 PM
mwink mwink is offline
 
Join Date: Mar 2008
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by NeverBored View Post
If you do what I wrote, you'll have what you want.

Copy and paste the postbit_attachmentimage template contents into the postbit_attachmentthumbnail template (overwrite the current postbit_attachmentthumbnail contents). And leave thumbnail creation on.
That's exactly what we did. Thumbnails in front of the thread titles are perfect, but the image inside the post is still a thumbnail instead of fullsize. This is very frustrating. Thanks for any futher suggestions you may have.

PS we tested it now using the vbulletin default template and have this problem there as well..

thanks again,

Paul
Reply With Quote
  #151  
Old 05-22-2008, 07:36 PM
NeverBored NeverBored is offline
 
Join Date: Feb 2008
Location: CA
Posts: 138
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by mwink View Post
That's exactly what we did. Thumbnails in front of the thread titles are perfect, but the image inside the post is still a thumbnail instead of fullsize. This is very frustrating. Thanks for any futher suggestions you may have.

PS we tested it now using the vbulletin default template and have this problem there as well..

thanks again,

Paul
I don't see how that's possible. The thumbnails in posts are displayed using the thumbnail template, so if the template isn't calling the thumbnail and are instead calling the full size image - which is what the change I posted does, it shouldn't even be possible for it to display the thumbnail.

To make sure, I just tested on my board again, and it works as it should. All uploaded images in posts are displayed at their full size.

The only thing I can think of is you reversed the templates (copied postbit_attachmentthumbnail to postbit_attachmentimage instead of the opposit). If that's not the case I really have no idea what the problem could be. Like I said I've tested it twice on my board and it worked instantly, and based on the simplicity of what it's doing I can't think of why it's not working for you.
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:59 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.05060 seconds
  • Memory Usage 2,325KB
  • 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
  • (4)bbcode_code
  • (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
  • (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