Go Back   vb.org Archive > vBulletin Modifications > vBulletin 3.8 Modifications > vBulletin 3.8 Add-ons

Reply
 
Thread Tools
Thread Thumbnails Details »»
Thread Thumbnails
Version: 2.20, by Null Parameter Null Parameter is offline
Developer Last Online: Apr 2014 Show Printable Version Email this Page

Category: New Posting Features - Version: 3.8.x Rating:
Released: 05-27-2009 Last Update: 04-08-2010 Installs: 258
DB Changes Uses Plugins Auto-Templates
Re-useable Code Translations  
No support by the author.

Thread Thumbnails
--------------------------------------
Created By: Null Parameter

This mod is officially tested with 3.8.1, but has been reported to work with many other versions.

Please leave any comments, suggestions or bugs.

Description

This mod allows a user, when creating or editing a thread, to specify a Thumbnail image to be used for display next to the thread in the Thread Listing.

With this mod you can define a set of forums that have thumbnails enabled, then in those forums whenever a user creates or edits their thread they can change their thumbnail, based on the method that you choose to allow.

This image is then shown in the Forum Display, in place of the Thread Icon.
The image also appears in Search & Tag Search, and I can add it to the regular Search if somebody requests it. And possibly have options for displaying in each area.

Forum Display:
Forum.jpg

Search:
Search.jpg

ACP Options:
ACP Options.jpg

Installation

Install the Product XML File. That's it!

All Template Edits Are Now Automatic.

If you are Upgrading from the older version, see directions in the README file on how to undo the template edits.

Demo

Possible Future Features (With Request)
  • Additional column instead of replacing Thread Icon
  • Displaying Thumbnail within thread
  • Edit thumbnail through Thread Edit
  • Thumbnail Preview in Edit Window
Fixes
  • Version 2.2
    • Fix Attachment + Default Thumbnail Option Combo
  • Version 2.1
    • Fix DB Error when using First Attachment option
    • Fix issue with New threads not saving thumbnail
  • Version 2
    • Added Features:
      • Automatic Template Edits
      • Thumbnails in Search
      • Thumbnails from First Image/First Attachment
      • Thumbnails on Sticky Threads
    • Fixes:
      • Miscellaneous Fixes

Download Now

File Type: zip product-thread_thumbnails_v22.zip (401.1 KB, 1523 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
2 благодарности(ей) от:
chikkoo, vijayninel

Comments
  #202  
Old 12-10-2009, 03:40 AM
Leonard Leonard is offline
 
Join Date: Dec 2001
Posts: 12
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hey guys,

So I had the same problem as some of you where, if you use attachments, only the first thread shows up on forumdisplay and all the other threads mysteriously disappear.

After a bit of digging the culprit was actually in a missing "group by" clause in the SQL statement.

Solution
Edit the plugin "Forum Display - Query"

Change the code to this:

Code:
$dothumbnail = false;
if((THIS_SCRIPT == 'forumdisplay') && ($vbulletin->options['thread_thumbnails_active'] == '1')){
	if ($vbulletin->options['thread_thumbnails_forum_list'] && $vbulletin->options['thread_thumbnails_forum_list'] != "") {
		$forumsallowed = explode(",", $vbulletin->options['thread_thumbnails_forum_list']);
		if (in_array($foruminfo['forumid'], $forumsallowed)){ 
			$dothumbnail = true;
			if($vbulletin->options['thread_thumbnails_thumbnail_source'] == '1'){
				$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "attachment AS attachment ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp'))";
				$hook_query_fields .= ", MIN(attachment.attachmentid) AS attachmentid";
				$hook_query_where .= "GROUP BY thread.threadid";

			} else {
				$hook_query_fields .= ", thread.thumbnailurl AS thumbnailurl";
			}
		}
	}
}
The missing line was
Code:
$hook_query_where .= "GROUP BY thread.threadid";
Working now....

Leo
Reply With Quote
  #203  
Old 12-10-2009, 09:15 AM
SoloX SoloX is offline
 
Join Date: Jun 2002
Posts: 135
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

search thumbnails only appear on the first page. The rest of the pages are displayed as normal (without thumbs). Is it just me? I have VBSEO installed.
Reply With Quote
  #204  
Old 12-10-2009, 09:34 AM
mykkal's Avatar
mykkal mykkal is offline
 
Join Date: May 2007
Location: Atlanta, GA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Leonard View Post
Hey guys,

So I had the same problem as some of you where, if you use attachments, only the first thread shows up on forumdisplay and all the other threads mysteriously disappear.

After a bit of digging the culprit was actually in a missing "group by" clause in the SQL statement.

Working now....

Leo
hey thanks... haven't tried it yet but I hope it will work. Hopefully the mod maker will release a patched version as well to make it easy on the non-technical folks.
Reply With Quote
  #205  
Old 12-10-2009, 01:45 PM
phkk phkk is offline
 
Join Date: Feb 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

$threadactiontime = (($feed['threadactiondelay'] > 0) ? (TIMENOW + $feed['threadactiondelay'] * 3600) : 0);

preg_match($pat,$pagetext,$matches);
$thumburl = escape_string($matches[1]);
$itemdata->set('thumbnailurl', $thumburl);
Reply With Quote
  #206  
Old 12-10-2009, 02:56 PM
phkk phkk is offline
 
Join Date: Feb 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
if ($type == 'thread')
            {
                if(
$vbulletin->options['thread_thumbnails_thumbnail_source'] == '0')
                {
                    
$dataman->setr('thumbnailurl'htmlspecialchars_uni($post['thumbnailurl']));
                }
                if(
$vbulletin->options['thread_thumbnails_thumbnail_source'] == '2')
                {
                
preg_match('/\[img\](.*?)\[\/img\]/i',$post['message'],$matches);
                
                
$dataman->setr('thumbnailurl'$matches[1]);
                }              
            } 
Reply With Quote
  #207  
Old 12-10-2009, 03:06 PM
phkk phkk is offline
 
Join Date: Feb 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

if ($type == 'thread')
{
if($vbulletin->options['thread_thumbnails_thumbnail_source'] == '0')
{
$dataman->setr('thumbnailurl', htmlspecialchars_uni($post['thumbnailurl']));
}
if($vbulletin->options['thread_thumbnails_thumbnail_source'] == '2')
{
preg_match('/\[img\](.*?)\[\/img\]/i',$post['message'],$matches);

$dataman->setr('thumbnailurl', $matches[1]);
}
}
Reply With Quote
  #208  
Old 12-10-2009, 03:26 PM
phkk phkk is offline
 
Join Date: Feb 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

not work
$pat = '/\[IMG\](.*?)\[\/IMG\]/i';
preg_match($pat,$pagetext,$matches);
$thumburl = escape_string($matches[1]);
$itemdata->set('thumbnailurl', $thumburl);
Reply With Quote
  #209  
Old 12-10-2009, 04:01 PM
phkk phkk is offline
 
Join Date: Feb 2006
Posts: 102
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

If you have RSS posts going to a forum like I do, you will have to do this:
in includes/cron/rssposter.php find
PHP Code:
$threadactiontime = (($feed['threadactiondelay'] > 0) ? (TIMENOW + $feed['threadactiondelay'] * 3600) : 0);

Put this below

preg_match('/\[img\](.*?)\[\/img\]/i',$pagetext,$matches);
$thumburl = ($matches[1]);
$itemdata->set('thumbnailurl', $thumburl);

now the thumbnail will appear on forum display like regular thread posts

The code work on my 3.8.4

it will draw the thumb from {feed:description}

any one know how to edit the {feed:description} and make it shorter or delete some characters?
Reply With Quote
  #210  
Old 12-16-2009, 12:43 PM
Taurus1's Avatar
Taurus1 Taurus1 is offline
 
Join Date: Dec 2009
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Leonard View Post
Hey guys,

So I had the same problem as some of you where, if you use attachments, only the first thread shows up on forumdisplay and all the other threads mysteriously disappear.

After a bit of digging the culprit was actually in a missing "group by" clause in the SQL statement.

Solution
Edit the plugin "Forum Display - Query"

Change the code to this:

Code:
$dothumbnail = false;
if((THIS_SCRIPT == 'forumdisplay') && ($vbulletin->options['thread_thumbnails_active'] == '1')){
	if ($vbulletin->options['thread_thumbnails_forum_list'] && $vbulletin->options['thread_thumbnails_forum_list'] != "") {
		$forumsallowed = explode(",", $vbulletin->options['thread_thumbnails_forum_list']);
		if (in_array($foruminfo['forumid'], $forumsallowed)){ 
			$dothumbnail = true;
			if($vbulletin->options['thread_thumbnails_thumbnail_source'] == '1'){
				$hook_query_joins .= "LEFT JOIN " . TABLE_PREFIX . "attachment AS attachment ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp'))";
				$hook_query_fields .= ", MIN(attachment.attachmentid) AS attachmentid";
				$hook_query_where .= "GROUP BY thread.threadid";

			} else {
				$hook_query_fields .= ", thread.thumbnailurl AS thumbnailurl";
			}
		}
	}
}
The missing line was
Code:
$hook_query_where .= "GROUP BY thread.threadid";
Working now....

Leo
Thanks mate! That did it!!
Reply With Quote
  #211  
Old 12-16-2009, 02:40 PM
fredang85 fredang85 is offline
 
Join Date: Sep 2007
Posts: 70
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Take a look here

When there is no attached pictures, there is a broken image.
Reply With Quote
Reply

Thread Tools

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 08:19 PM.


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.05223 seconds
  • Memory Usage 2,340KB
  • Queries Executed 26 (?)
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
  • (1)bbcode_php
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (2)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (2)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (1)postbit_attachment
  • (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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete