vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Thread Thumbnail (https://vborg.vbsupport.ru/showthread.php?t=98651)

jasonmerchant 10-17-2005 10:00 PM

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

MGM 10-18-2005 02:46 AM

Oh wow, this could come in real handy. Thanks a lot!

MGM out

Floris 10-18-2005 02:47 AM

XHTML <img tags> are to be closed with <img /> and border=0 should be border="0"

tnx for sharing! :)

Floris 10-18-2005 02:50 AM

All threads listed show up with the nothumb image, none of them with attachment shows the thumbnail in the threadlist.

jasonmerchant 10-18-2005 03:10 AM

:o , sorry somehow mixed up the xml file, i reuploaded it... I forgot the alt="" too :o, everything looks right now...

Xplorer4x4 10-18-2005 03:14 AM

Is there a way that a user can choose to disable it as well? Say for dial up users?

jasonmerchant 10-18-2005 03:26 AM

Sorry to do this again but I just found a better way to check if the attachment is a image, please reinstall both the xml and template changes.

jasonmerchant 10-18-2005 03:29 AM

Quote:

Originally Posted by Xplorer4x4
Is there a way that a user can choose to disable it as well? Say for dial up users?

yes that shouldn't be too hard, I'll look into tomorrow as I'm about to go to sleep.

trancetopia 10-18-2005 10:06 AM

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.

Snake 10-18-2005 12:10 PM

Thanks.


All times are GMT. The time now is 10:24 AM.

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.03890 seconds
  • Memory Usage 1,755KB
  • 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
  • (4)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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