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)

usmansabir 06-27-2008 10:33 PM

3.6.8 .. installed . showed NO THUMBNAIL in the forums i defined in array .. and SQL error while going for New post .. so didnt have any option .. uninstalled :( but i like this thingi..

theOZer 06-27-2008 11:29 PM

usmansabir,
This mod/hack is priceless if you have an art forum. This hack has worked for me from vB3.6.5 through vB3.7.2, but, since vB3.6.8 came out you have to tweak the search.php so new post search works (see page 8, post #112, 114). Also, don't forget you need to turn on thread thumb creation (see page 9, post #121). If you have linked and/or full image (non-thumbnailed) images in a new thread's 1st post then a thumbnail is NOT available, thusly, it won't show up as a thumbnail, regardless.

Defkalion 06-28-2008 05:55 PM

@theOZer: have you found a way to make this work also in tag search?

theOZer 06-29-2008 05:08 PM

FYI: This mod and the search.php tweak work in vB3.7.2.
We're fortunate, once again, this works by bastardizing search.php. Yes, there has got to be a better way.
No, Defkalion, I have not worked with adding this to Tags. I'm not a coder but this does intrique me. I would like to, first and foremost, use vB's hooks in the search.php, to "properly" incorporate ThreadThumbnails into New Posts search. Then, maybe, after learning how to do that I can also do this in Tags; it may just fall all into place. There's a vB SDK (I believe) that I can download, read, then take it from there. We will see.
P.S. NeverBored also offers good help (page 8 - 10) on how to display 'full page' threads.

rolfw1 07-01-2008 03:46 PM

All I did when I upgraded to 3.7.2, was upload the old modified search.php file (after I found that the new 3.7.2 version was generating an SQL error), did you modify your new 3.7.2 version, or just replace it with the old modified one, if you modified it, I'd like to see what you did, as I think I may be missing some features by using the old modified one.

Also, has anyone got it to work when searching for individual posts and not threads? As my main section is photo based and it would look a lot better.

theOZer 07-01-2008 05:17 PM

rolfw1,
You HAVE TO MODIFY the vB3.7.2 search.php, adding the Thread Thumbnail 'hook' (see page 8, post #112, 114).
I believe that this mod, as it's currently written, only checks for an image attachment on the 1st post of a thread.

theOZer 07-02-2008 12:29 PM

Yay! I got Thread Thumbnails to so show up in a TAG Search!!!

I created a Thread Thumbnail Tag Search plugin, copying thread-thumbnail-plugins.xml then tweaking it.
I had to make minor changes to Tag.php.
I had to add an additonal If statement to the threadbit template to get Tag search thumbnails to display.
I need to put together a 'How I Did This' write-up. I'll get this done today.
P.S. I plan to post my write-up, soon.

Defkalion 07-02-2008 02:14 PM

COOL!!!! Can't wait to implement this! :)

theOZer 07-02-2008 02:38 PM

Adding Thread Thumbnails to Tag Search

Salute to Jason Merchant the original coder of this excellent Thread Thumbnails mod. Salute to vB.org for hosting this mod's thread.

This is a 'How I Did It.' I hope this is ethically correct that I can post this tweak, seeing how I stole the plugin from Jason and tags.php needs to be modified. I have this up-and-running on my forum; it works for me, okay?

tags.php needs to be slightly tweaked to make this all happen.
You will need to install a plugin.
You will need to modify your threadbit template(s).

[Note: Before changing your current tags.php file make a backup copy named tags_original.php, for example.]

A) Tweak the tags.php file:

Change tags.php

>>Find:

$hook_query_fields = $hook_query_joins = '';
($hook = vBulletinHook::fetch_hook('tags_list_query_data')) ? eval($hook) : false;

>>Change the 1st line to:

$hook_query_fields = $hook_query_joins = $hook_query_where = '';
($hook = vBulletinHook::fetch_hook('tags_list_query_data')) ? eval($hook) : false;

At the bottom of the following select statement -

>>Find:

$hook_query_joins
WHERE thread.threadid IN (" . implode(',', $threadids) . ")

>>Change the 2nd line to:

$hook_query_joins
WHERE thread.threadid IN (" . implode(',', $threadids) . ") $hook_query_where

B1) Create the plugin .xml file:

Copy the following xml code, pasting it into Wordpad or Notepad. Save the file as a .xml. For example, I named mine: thread-thumbnail-plugins-tags.xml

Code:

<?xml version="1.0" encoding="ISO-8859-1"?>

<plugins>
        <plugin active="1" executionorder="5" product="vbulletin">
                <title>Thread Thumbnail - Tag Search</title>
                <hookname>tags_list_query_data</hookname>
                <phpcode><![CDATA[$tt_displaythumbs_tags = true;
        $hook_query_fields .= ", attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid ";
        $hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) ";
        $hook_query_where .= "GROUP BY thread.threadid ";]]></phpcode>
        </plugin>
</plugins>

B2) Import the plugin:

In Admin Control Panel > Plugins & Products > Download/Upload Plugins > Import Plugin Definitions XML File window, Import the .xml file you just created.

C) threadbit template changes:

Here's my New & Improved threadbit template change to thread thumbnail both regular searches and Tag searches. Your current TT code may differ from mine, for sure.

Code:

<!-- Thread Thumbnails -->
<if condition="$show['threadicons']">
  <td class="alt2" align="center" valign="middle">
<!-- TAG Search Thread Thumbnails -->
  <if condition="($tt_displaythumbs_tags)">
    <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 />
      <if condition="$show['threadicon']">
        <img src="$thread[threadiconpath]" alt="$thread[threadicontitle]" border="0" />
      <else />
        &nbsp;
      </if>
    </if>
  <else />
<!-- Thread Thumbnails in Forums & Search -->
    <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" />
      <else />
        &nbsp;
      </if>
    </if>
  </if>
  </td>
</if>
<!-- end of Thread Thumbnails -->

Enjoy!

Regards, theOZer

Defkalion 07-02-2008 03:20 PM

Aaarrrgh!! It works!! :)

I just have to figure out why it's leaving such a big space for the thumbs column now. :P

Many thanks man. Any ideas for the thumbs column width?

Edit: Don't worry about it, already fixed it, it was an extra </td> making the damage.

It's working GREAT!

Thankyou so much for your effort theOZer :)


All times are GMT. The time now is 08:04 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.01241 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
  • (2)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)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