vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.8 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=235)
-   -   New Posting Features - Thread Thumbnails (https://vborg.vbsupport.ru/showthread.php?t=214755)

Leonard 12-10-2009 03:40 AM

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

SoloX 12-10-2009 09:15 AM

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.

mykkal 12-10-2009 09:34 AM

Quote:

Originally Posted by Leonard (Post 1928141)
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.

phkk 12-10-2009 01:45 PM

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

preg_match($pat,$pagetext,$matches);
$thumburl = escape_string($matches[1]);
$itemdata->set('thumbnailurl', $thumburl);

phkk 12-10-2009 02:56 PM

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]);
                }              
            } 


phkk 12-10-2009 03:06 PM

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]);
}
}

phkk 12-10-2009 03:26 PM

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

phkk 12-10-2009 04:01 PM

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?

Taurus1 12-16-2009 12:43 PM

Quote:

Originally Posted by Leonard (Post 1928141)
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!! :D

fredang85 12-16-2009 02:40 PM

Take a look here

When there is no attached pictures, there is a broken image.

RedHacker 12-16-2009 03:24 PM

I install first time version 2 but not show thumbnails...

segwayon 12-18-2009 07:54 PM

Thanks for developing this mod. It comes in handy when posting YouTube videos with the thumbnail images.

I had to set the width property in the AdminCP options in order to get the image to show. New threads are now working fine with URL images. However, I notice that when I edit a thread it doesn't want to show the thumbnail URL input box. I manually edited the templates, including the "editpost" one. Any suggestions?

Update: I got the image URL box to appear on an edit by clicking on the "Go Advanced" button, at least for adding a fresh, new thumbnail onto an old thread.

fredang85 12-19-2009 12:07 PM

Quote:

Originally Posted by fredang85 (Post 1931688)
Take a look here

When there is no attached pictures, there is a broken image.

Can someone help out? :P

Thanks..

segwayon 12-19-2009 01:04 PM

Quote:

Originally Posted by fredang85 (Post 1933417)
Can someone help out? :P

Thanks..

I wish I could assist, as I'm using the URL method and I'm new to this mod. It looks like those broken image links are there because the threads in question do not have any attached images in them, and as I recall the attachments have to be in the first post within each thread. Not sure if there's a method to avoid these kinds of broken links for attachments, though, and I'll be watching this thread for results, too.

SoloX 12-19-2009 01:55 PM

Quote:

Originally Posted by fredang85 (Post 1933417)
Can someone help out? :P

Thanks..

right click on the image and see if its pointing the same link. if it does, then just place a blank or NOIMAGE image. :)

space? 12-20-2009 03:42 PM

it doesnt works with vb 3.8.3. the auto edit doesnt work. the images doesnt show. can anybody give me the code for the manuel edit please?

segwayon 12-21-2009 05:03 AM

Quote:

Originally Posted by space? (Post 1934102)
it doesnt works with vb 3.8.3. the auto edit doesnt work. the images doesnt show. can anybody give me the code for the manuel edit please?

Have you set the minimum width or height in the options? My URL images appeared after I set the size.

DirtNations 12-21-2009 05:27 AM

Is it possible to specify specific forums for this mod to work in? I only want this to be attached to my classifieds forum, and not the rest.

RTimm 12-21-2009 08:07 AM

Quote:

Originally Posted by DirtNations (Post 1934408)
Is it possible to specify specific forums for this mod to work in? I only want this to be attached to my classifieds forum, and not the rest.


There is an ACP setting called "Show in what forums?" where you put the forum ID of the forum(s) you want thumbnails to show for into the text box separated by commas.

ACP > vBulletin Options > Thread Thumbnails Options > Show in what forums?

DirtNations 12-21-2009 08:15 AM

Ah that is absolutely fantastic. Thanks so much for the reply. This is going up, ASAP.

milsirhc 12-21-2009 08:53 AM

Is this workable on V4?

Can we also display the thread title in the show thread page?

apiasto 12-21-2009 07:27 PM

doesn't work

VBUsers 01-02-2010 04:18 AM

uninstalled - thanks but to buggy for me

vBB-vietnam 01-02-2010 03:29 PM

i need it for V4
help me plz

powerful_rogue 01-02-2010 07:03 PM

Hi,
Im really hoping someone may be able to help.

Ive got the mod set to show the thumbnail of an attachment, however when an attachment isnt included within a thread, it just shows a red X.

I added a link to show a "no image" picture, but it still seems to be looking for an attachment when one hasnt been included.

Any help greatly appreciated

deluxmall 01-05-2010 10:51 AM

I need this for VB4 as well.

Anyone help?

jayfenney 01-15-2010 10:30 AM

I've installed this and it works great for the most part, except I get the same problem as gantonr. The template edits have worked fine and there's no issue with the thumbnails showing, except when I have it set to use the first attachment. I get the following database error

Code:

Database error in vBulletin 3.8.4:

Invalid SQL:

                SELECT
                        IF(votenum >= 1, votenum, 0) AS votenum,
                        IF(votenum >= 1 AND votenum > 0, votetotal / votenum, 0) AS voteavg,
                post.pagetext AS preview,
                        thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, postusername, postuserid, thread.iconid AS threadiconid,
                        thread.dateline, notes, thread.visible, sticky, votetotal, thread.attach, thread.lastpost, thread.lastposter, thread.lastpostid, thread.replycount, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views,
                        thread.prefixid, thread.taglist, hiddencount, deletedcount
                        , NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed
                        , deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason
                        , threadread.readtime AS threadread
                        , threadredirect.expires
                        , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid , MIN(attachment.attachmentid) AS attachmentid
                FROM thread AS thread
                        LEFT JOIN deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')
                        LEFT JOIN subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = 2 AND canview = 1)
                        LEFT JOIN threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = 2)
                        LEFT JOIN post AS post ON(post.postid = thread.firstpostid)
                       
                        LEFT JOIN threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)
                        LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) LEFT JOIN attachment AS attachment ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp'))
                WHERE thread.threadid IN (0,840,433,889,814,895,900,880,890,808,897,876,835,887,877,733,879,806,874,732,883,483) GROUP BY thread.threadid
                ORDER BY sticky DESC, lastpost DESC;

MySQL Error  : Not unique table/alias: 'attachment'
Error Number  : 1066
Request Date  : Friday, January 15th 2010 @ 04:58:03 AM
Error Date    : Friday, January 15th 2010 @ 04:58:04 AM
Script        : http://www.lightspeed-art.com/community/3d-wips-f13.html
Referrer      : http://www.lightspeed-art.com/community/battleship-thirty-twevle-t840.html
IP Address    : 90.210.63.183
Username      : Scorpius
Classname    : vB_Database
MySQL Version : 5.1.42


angeljs 01-15-2010 02:23 PM

Quote:

Originally Posted by deluxmall (Post 1947745)
I need this for VB4 as well.

Anyone help?

Me, too! :D

BillieJoe 01-15-2010 03:13 PM

ok i really need help, i searched the thread but didnt find out how to fix it.

if i directly put in the thumbnail like this
Code:

[img]https://vborg.vbsupport.ru/external/2010/01/15.gif[/img]
and i dont have another img code in that line the preview works.
but if there are 2 img codes per line or hotlinked images like
Code:

[URL=http://img240.imagevenue.com/img.php?image=72507_olivia-wilde-1920x1200-36389_122_111lo.jpg][IMG]http://img240.imagevenue.com/loc111/th_72507_olivia-wilde-1920x1200-36389_122_111lo.jpg[/IMG][/URL]
it doenst work
how can i fix it?

islam mohamed 01-22-2010 08:51 PM

hello

i need see that hack in vBadvanced cuz no work in portal

plz help me

Thanks

milsirhc 01-23-2010 11:35 PM

Is it possible to put a value for height??

This mod works great, but my thumbnail are all of different height... and when they resize it according to the width.. the heights are all diff.

Anyone know how to change it?

Xtrigit 02-02-2010 11:21 PM

I need this for vbulletin 4 please!!!

Mike_K 02-08-2010 05:10 PM

This is a great mod! Would be nice to have it also on VB 4

bosal 02-09-2010 08:44 PM

Please make it for vBulletin 4.0 or even vBadvanced :)

Aceman 02-18-2010 01:55 PM

Definitely need for 4.0.X - I'll make a donation if you code it for 4.0 to you or your site.

angeljs 02-18-2010 02:25 PM

Quote:

Originally Posted by Aceman (Post 1985612)
Definitely need for 4.0.X - I'll make a donation if you code it for 4.0 to you or your site.

Me too :)

oldford 02-19-2010 01:13 PM

Quote:

Originally Posted by jayfenney (Post 1956371)
I've installed this and it works great for the most part, except I get the same problem as gantonr. The template edits have worked fine and there's no issue with the thumbnails showing, except when I have it set to use the first attachment. I get the following database error

Code:

Database error in vBulletin 3.8.4:

Invalid SQL:

                SELECT
                        IF(votenum >= 1, votenum, 0) AS votenum,
                        IF(votenum >= 1 AND votenum > 0, votetotal / votenum, 0) AS voteavg,
                post.pagetext AS preview,
                        thread.threadid, thread.title AS threadtitle, thread.forumid, pollid, open, postusername, postuserid, thread.iconid AS threadiconid,
                        thread.dateline, notes, thread.visible, sticky, votetotal, thread.attach, thread.lastpost, thread.lastposter, thread.lastpostid, thread.replycount, IF(thread.views<=thread.replycount, thread.replycount+1, thread.views) AS views,
                        thread.prefixid, thread.taglist, hiddencount, deletedcount
                        , NOT ISNULL(subscribethread.subscribethreadid) AS issubscribed
                        , deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason
                        , threadread.readtime AS threadread
                        , threadredirect.expires
                        , attachment.thumbnail_filesize AS thumbsize , MIN(attachment.attachmentid) AS attachmentid , MIN(attachment.attachmentid) AS attachmentid
                FROM thread AS thread
                        LEFT JOIN deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')
                        LEFT JOIN subscribethread AS subscribethread ON(subscribethread.threadid = thread.threadid AND subscribethread.userid = 2 AND canview = 1)
                        LEFT JOIN threadread AS threadread ON (threadread.threadid = thread.threadid AND threadread.userid = 2)
                        LEFT JOIN post AS post ON(post.postid = thread.firstpostid)
                       
                        LEFT JOIN threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)
                        LEFT JOIN attachment as attachment ON(attachment.postid = thread.firstpostid AND (attachment.extension = 'jpg' OR attachment.extension = 'gif' OR attachment.extension = 'png')) LEFT JOIN attachment AS attachment ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp'))
                WHERE thread.threadid IN (0,840,433,889,814,895,900,880,890,808,897,876,835,887,877,733,879,806,874,732,883,483) GROUP BY thread.threadid
                ORDER BY sticky DESC, lastpost DESC;

MySQL Error  : Not unique table/alias: 'attachment'
Error Number  : 1066
Request Date  : Friday, January 15th 2010 @ 04:58:03 AM
Error Date    : Friday, January 15th 2010 @ 04:58:04 AM
Script        : http://www.lightspeed-art.com/community/3d-wips-f13.html
Referrer      : http://www.lightspeed-art.com/community/battleship-thirty-twevle-t840.html
IP Address    : 90.210.63.183
Username      : Scorpius
Classname    : vB_Database
MySQL Version : 5.1.42


Ditto. Sounds like several people in this thread have reported this problem, but I haven't seen a solution posted.

Mike_K 02-22-2010 12:47 PM

Quote:

Originally Posted by angeljs (Post 1985634)
Me too :)

will make also a donation.... :)

Null Parameter 02-25-2010 11:59 PM

I don't have vB 4.0 and I actually don't even have admin access to the forum I had used to develop it on. So basically, I have no way to do it, even if I wanted to.

The attachments is a known problem, and because I didn't have a working development server that supported attachments, I could never debug the issue.

Sorry for the lack of support lately, but my computer took a dive and I retired from admin on the vB forum that I had been running.

Mike_K 02-26-2010 12:15 PM

Would it help if you have access to a VB 4 test board? Or what do you need more?


All times are GMT. The time now is 09:34 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.01689 seconds
  • Memory Usage 1,869KB
  • 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
  • (8)bbcode_code_printable
  • (1)bbcode_php_printable
  • (11)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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