vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.6 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=194)
-   -   Forum Display Enhancements - Thread Thumbnail (https://vborg.vbsupport.ru/showthread.php?t=158396)

jasonmerchant 09-20-2007 10:00 PM

Thread Thumbnail
 
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.

V-T-H 09-21-2007 07:30 PM

let me be the 1st to thank u

grazianno 09-21-2007 07:37 PM

wow great :)

nnjj.net 09-21-2007 07:40 PM

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

where???

peterpigman 09-21-2007 07:44 PM

Nice, i will update later ty.

ThomasR 09-21-2007 07:53 PM

Is this plugin show the first -image- in attachement? I mean, if the first attachemnt is a file and the second an attachement, does it display the thumbnail and not an "no image" icon?

jasonmerchant 09-21-2007 08:17 PM

nnjj.net:


On the first line:

Code:

$tt_thumbsforums = array(2);
Change 2 to the forum id. So if you want to enable thumbnails in forums 3, 7, and 12, it would look like:

Code:

$tt_thumbsforums = array(3, 7, 12);
A new version of the plugin is available. You can find the new thread here.


ThomasR:

If the first attachment is a non-image file(ie: zip, txt, etc.), it will be skipped, and it will show the first image attachment.

This is a new feature, just added in this version.

nnjj.net 09-21-2007 09:00 PM

how I can disaply the image if there is no image attachment instead of showing no thumb?

Spank 09-21-2007 09:13 PM

This will come in handy in the near future. Thanks.

theOZer 09-22-2007 12:16 AM

Upgraded from TT V1.0. Works great. Seems a bit perkier, too. Excellent.
May I advise that if updating from TT V1.0, after noting the forums in your current Thread Thumbnail plugin that will need re-inserted, delete your TT V1.0 plugin, then install TT V1.1. Maybe this is just understood when doing plugin updates. I'm a rookie mostly. Whatever...
Also, the V1.0 template changes didn't appear to need massaged. Those changes are already in place. Good.
Great Hack/Mod. This adds so much to displayed art forums. Great idea.
Post Thoughts 9/22/2007:
Thumbnails in New Posts caps this off! Nice touch.

bing11 09-22-2007 12:20 AM

thank you nice work

b65ran 09-22-2007 01:17 AM

Thanks a lot. I was waiting for this for a long time. Is there a way to show thumbnails to unregistered users ?

Hornstar 09-22-2007 05:26 AM

WOW this looks awesome, I will need to have a good look at this one for sure. Thanks.

ThomasR 09-22-2007 08:14 AM

Quote:

Originally Posted by jasonmerchant (Post 1344079)
nnjj.net:
ThomasR:

If the first attachment is a non-image file(ie: zip, txt, etc.), it will be skipped, and it will show the first image attachment.

This is a new feature, just added in this version.

Ok, great !
And in the original hack of the thread thumbnail, if an attached image (I mean an image which is equal or less the size of the thumbnail size) and and attachement which is a full size image, the hack display in the threadlist only the attached image and not the thumbnail of the full size image. If no attached image, then, it's the thumbnail which is display.
It's the exact behavior of the original hack.
Anyway, the current one is better than the previous one, thank you for your update!

PS: if you don't understand what I mean, I can show you some sample on my own forum

rayphua 09-22-2007 08:30 AM

Im not sure why mine isn't working. Using vb 3.6.7pl1.

peterpigman 09-22-2007 11:08 AM

The only problem with the search thumbs is if you don't use thumbs in all forums you get a load of no thumb available. Could you not make it so it would only work if someone is searching a section that has it active?

Snake 09-22-2007 11:19 AM

I'll definitely install this when I have the time. Thanks anyway!

Mecho 09-22-2007 11:43 AM

is there anyway that it uses the image that users posted via [img] tag ??

jasonmerchant 09-22-2007 11:31 PM

nnjj.net:

I'm not sure what you mean. Do you just want to show an empty space instead of the "no thumbnail" image?

theOzer:

Yes you will need to delete the old plugin first. If there is an alternative standard with other plugins, please let me know.

I will look into the new posts page. It should not be difficult.

b65ran:

Unregistered users see the thumbnails by default.

ThomasR:

Please send me a link, and I will take a look at it.

rayphua:

If you installed the plugin correctly, be sure that you inserted your forum ids into the 1st line of the plugin.

Peterpigman:

I will look into it, possibly by next weekend.

Mecho:

Unfortunately that would require a larger plugin. As the images would need to be searched for and resized on the fly.

I have a few projects at the moment, so I don't know how soon I can start working on it. I will let you if any progress is made.

Trana 09-23-2007 02:00 AM

Will this work without globally enabling image thumbnailing? I want to view the full sized image attachments within threads but would like to use this mod.

Any ideas how I can do this?

Thanks!

rayphua 09-23-2007 06:12 AM

I have your previous version installed and working fine, and I need to know what are the steps I need to take to get it upgraded to this current version. Please advice! Thanks.

Mecho 09-23-2007 08:05 AM

ok thanks Jason . hope u will be free soon and add img tag option too ;)

cheers

InTeNsE-HuMoR 09-23-2007 09:30 AM

Please can we have the option to allow admins to specify a custom thumbnail? For example; if a thread does not have an attachment but has embeded content like a Youtube video, I want to be able to take a screenshot and then uploaded it as the thumbnail.

snapshotz 09-23-2007 04:09 PM

is there a way to set a custom size for the thumbs in the threadbit, would like to make the thumbs a bit smaller, rather than using the default thumbnail size.

peterpigman 09-23-2007 07:12 PM

Quote:

Originally Posted by snapshotz (Post 1345243)
is there a way to set a custom size for the thumbs in the threadbit, would like to make the thumbs a bit smaller, rather than using the default thumbnail size.

I|t is in the threadbit template

Quote:

<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="" width=120 height=100 border="0" />
</a>
<else />
<img src="$stylevar[imgdir_misc]/nothumb.jpg" alt="" border="0" />
</if>
<else />
<if condition="$show['threadicon']">

snapshotz 09-24-2007 12:59 AM

awesome, thanks for the tip

htrshgytrs 09-24-2007 03:37 AM

Quote:

Originally Posted by peterpigman (Post 1344506)
The only problem with the search thumbs is if you don't use thumbs in all forums you get a load of no thumb available. Could you not make it so it would only work if someone is searching a section that has it active?

I'd like to add my vote to the above as well, thanks again :)

rolfw1 09-24-2007 07:27 AM

Thanks, just what I needed, really looks good on this section. :)

I've only set it up for one section at the moment, do I change the XML file and re-import it to add new sections, or is there another way?


Sorry scratch that, just edit it in the plugin manager. :)

htrshgytrs 09-24-2007 11:00 PM

Quote:

Originally Posted by peterpigman (Post 1344506)
The only problem with the search thumbs is if you don't use thumbs in all forums you get a load of no thumb available. Could you not make it so it would only work if someone is searching a section that has it active?

i think i've worked around this. I wrapped the no thumb section in a thisscript condition, works well enough for me. Thumbs will only be displayed on the search pages if a thumbnail exists.

ie Find -

Quote:

<img src="$stylevar[imgdir_misc]/nothumb.jpg" alt="" border="0" />
replace with -

Quote:

<if condition="THIS_SCRIPT != 'search'">
<img src="$stylevar[imgdir_misc]/nothumb.jpg" alt="" border="0" />
</if>

jasonmerchant 09-25-2007 05:30 AM

Trana:

Did you have any success with the code I posted before?

rayphua:

There isn't a clean upgrade, so you will need to uninstall the previous version and reinstall the new version. The template changes are the same as the previous version, so you don't have to change those, just reinstall the plugin and add your forum id's.

htrshgytrs:

...That script will not work, it will prevent all thumbnails from showing on the search page. Are thumbnails are showing up?

Trana 09-25-2007 05:37 AM

Quote:

Originally Posted by jasonmerchant (Post 1346565)
Trana:
Did you have any success with the code I posted before?

No, I posted a reply stating that I wasn't sure what exactly you wanted me to edit in there.

Please explain.

Thanks!

htrshgytrs 09-25-2007 05:46 AM

Quote:

Originally Posted by jasonmerchant (Post 1346565)

htrshgytrs:

...That script will not work, it will prevent all thumbnails from showing on the search page. Are thumbnails are showing up?

yup, works exactly as i want it to with that above conditional ;

http://img530.imageshack.us/img530/5203/11gj2.png



Images where there are thumbnails and nothing where there is not. Works both on the getnewposts and search results pages.


edit - actually i did change it after i posted earlier so i may have confused the issue.. The above result is achieved with the follow template edit within threadbit ;

Quote:

<if condition="$show['threadicons']">
<td class="alt2" align="center" valign="middle">
<if condition="($tt_displaythumbs) AND ($bbuserinfo['field11'] <> 'Off' OR $show['guest'])">
<if condition="($thread['attachmentid']) AND ($thread['thumbsize'])">
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]">



<if condition="THIS_SCRIPT == 'search'">
<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" alt="" width=70 height=45 border="0" />
</a>
<else />

<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" alt="" border="0" />
</if>
<if condition="THIS_SCRIPT != 'search'">
<img src="$stylevar[imgdir_misc]/nothumb.jpg" alt="" border="0" />
</if>
</if>

<else />


<if condition="$show['threadicon']">
<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
</if>
</if>

</td>
</if>

htrshgytrs 09-26-2007 10:28 PM

my above change to your code is still wrong, so i'll wait for someone who knows what they are talking about ;)

This is the code i use now. The above screenshot shows the search pages and thumbs still display on the forumdisplay pages. The no thumb images are never shown though, ie if there is no attachment the field will be blank.

Quote:

<if condition="$show['threadicons']">
<td class="alt2" align="center" valign="middle">
<if condition="($tt_displaythumbs) AND ($bbuserinfo['field11'] <> 'Off' OR $show['guest'])">
<if condition="($thread['attachmentid']) AND ($thread['thumbsize'])">
<a href="showthread.php?$session[sessionurl]t=$thread[threadid]">



<if condition="THIS_SCRIPT == 'search'">
<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" alt="" width=70 height=45 border="0" />
</a>
<else />

<img src="attachment.php?attachmentid=$thread[attachmentid]&stc=1&thumb=1" alt="" border="0" />
</if>
</if>

<else />


<if condition="$show['threadicon']">
<img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
</if>
</if>

</td>
</if>

bqtstudio 09-29-2007 08:39 AM

Thx 4 this realea ! installed !

dontcry 09-30-2007 11:38 AM

Great mod!

I would suggest 2 things:

1. When click on the thumb, the full-size image will be ajaxed-appeared. (HighSlide)

2. Changes the threads display of the specified forum from horizontal to vertical.

Thanks alots for this wonderful mod!

theFAILURE 09-30-2007 04:13 PM

Does this work on 3.6.7PL1? As soon as I installed it, I got an invalid SQL when searching for "new posts."

I quickly deleted it to resolve the issue.

Quote:

Originally Posted by SQL
MySQL Error : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause


InTeNsE-HuMoR 10-01-2007 03:32 PM

Can we have the option to specify our own thumbnail for non-attachments like embeded videos?

rolfw1 10-01-2007 06:06 PM

Love the mod as stated earlier, is it possible to add thumbnails to the search function when opting to show posts?

The Fat Boy 10-02-2007 02:57 AM

cant get this to work for anything... doesnt display anything. edited the threadbit... no luck

ok... working to some degree, except it will not show a thumbnail for anything, it always shows the no thumbnail image

theFAILURE 10-02-2007 01:34 PM

Quote:

Originally Posted by theFAILURE (Post 1350262)
Does this work on 3.6.7PL1? As soon as I installed it, I got an invalid SQL when searching for "new posts."

I quickly deleted it to resolve the issue.

Did anyone get this working on 3.6.7PL1 or is this just a local problem with my database?


All times are GMT. The time now is 01:08 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02740 seconds
  • Memory Usage 1,847KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (13)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete