
12-16-2009, 12:43 PM
|
 |
|
|
Join Date: Dec 2009
Posts: 648
Благодарил(а): 0 раз(а)
Поблагодарили:
0 раз(а) в 0 сообщениях
|
|
Quote:
Originally Posted by Leonard
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!!
|