Version: 2.20, by Null Parameter
Developer Last Online: Apr 2014
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.
After updating the mod to the current version, I get the following database error when selecting the "First Attachment" option in the Thumbnail Source part of the mod. The "User Entered URL" and "First Image In Post" options both appear to be working with no problems.
I hope a fix can be found for this error.
PHP Code:
Database error in vBulletin 3.7.3:
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, replycount, IF(views<=replycount, replycount+1, views) AS views,
thread.prefixid, thread.taglist, hiddencount, deletedcount
, deletionlog.userid AS del_userid, deletionlog.username AS del_username, deletionlog.reason AS del_reason
, threadredirect.expires
, hasannuser.displaygroupid AS hasanndisplaygid, hasannuser.usergroupid AS hasannusergid, huseyinuser.displaygroupid AS huseyindisplaygid, huseyinuser.usergroupid AS huseyinusergid, MIN(attachment.attachmentid) AS attachmentid
FROM board_thread AS thread
LEFT JOIN board_deletionlog AS deletionlog ON(thread.threadid = deletionlog.primaryid AND deletionlog.type = 'thread')
LEFT JOIN board_post AS post ON(post.postid = thread.firstpostid)
LEFT JOIN board_threadredirect AS threadredirect ON(thread.open = 10 AND thread.threadid = threadredirect.threadid)
LEFT JOIN board_user AS hasannuser ON (thread.lastposter = hasannuser.username)
LEFT JOIN board_user AS huseyinuser ON (thread.postuserid = huseyinuser.userid)LEFT JOIN board_attachment AS attachment ON (attachment.postid = thread.firstpostid AND attachment.extension IN('jpg', 'gif', 'png', 'jpeg', 'bmp'))
WHERE thread.threadid IN (0,33703,33677,33670,33669,33646,33625,33624,33612,33611,33609,33597,33594,33590,33578,33570,33569,33565,33552,33540,33530,33529,33516,33499,33498,33487,33484,33471,25660,25688,25725,25655,25945)
ORDER BY sticky DESC, lastpost DESC;
MySQL Error : Mixing of GROUP columns (MIN(),MAX(),COUNT(),...) with no GROUP columns is illegal if there is no GROUP BY clause
Error Number : 1140
Request Date : Monday, November 2nd 2009 @ 10:56:21 AM
Error Date : Monday, November 2nd 2009 @ 10:56:22 AM
Script : http://www.******.com/forums/forumdisplay.php?f=80
Referrer : http://www.******.com/forums/index.php
IP Address : 98.***.***.***
Username : *** ***
Classname : vB_Database
MySQL Version : 5.0.45
youre wrong "First Image In Post" isnt working how it should! (image isnt shown after posting)
If I use the img tags in the first post in the thread, it works on my board.
Once the "First Attachment" is working properly I would like to able to use both the "First Attachment" and "First Image In Post" together as a option. Hopefully Null Parameter will stay on top of this and get it taken care of asap.
If I use the img tags in the first post in the thread, it works on my board.
Once the "First Attachment" is working properly I would like to able to use both the "First Attachment" and "First Image In Post" together as a option. Hopefully Null Parameter will stay on top of this and get it taken care of asap.
realy working without need to edit the post?? maybe youve had an older version of thumbmod befor ... give me please your boardurl with pn or post it here . i want to test it.
realy working without need to edit the post?? maybe youve had an older version of thumbmod befor ... give me please your boardurl with pn or post it here . i want to test it.
You are right. I have to edit the post in order for it to appear.
Thanks for your work , but im getting an error while running the file "Database error".
and i think it isnt a permanently solution ,which causes an extream amount of server LOAD.
did you tested it? do i have to modifiy something? (my sqltable prefix is "vb")
Quote:
Originally Posted by megamoose
You can use this to update all previously posted threads using First IMG in post
Upload it to your server root as something like xupdater.php and run.
Then DELETE it.
WARNING! For large forums it may take some time to run the script, and if you have a max exec time then you may have to add breaks in it.
Code:
<?php
error_reporting(E_ALL & ~E_NOTICE & ~8192);
// #################### DEFINE IMPORTANT CONSTANTS #######################
define('SKIP_SESSIONCREATE', 1);
define('NOCOOKIES', 1);
define('THIS_SCRIPT', 'xupdate');
define('CSRF_PROTECTION', true);
// #################### PRE-CACHE TEMPLATES AND DATA ######################
// get special phrase groups
$phrasegroups = array();
// get special data templates from the datastore
$specialtemplates = array();
// pre-cache templates used by all actions
$globaltemplates = array();
// pre-cache templates used by specific actions
$actiontemplates = array();
// ######################### REQUIRE BACK-END ############################
require_once('./global.php');
$threads = $db->query_read_slave("SELECT * FROM thread");
while ($thread = $db->fetch_array($threads)){
echo "<b>Thread:</b> ".$thread["title"]."<br>";
$posts = $db->query_read_slave("SELECT * FROM `post` WHERE `postid` = '".$thread["firstpostid"]."'");
$post = $db->fetch_array($posts);
echo "
<b>First Post:</b> ".$post["title"]."<br>";
preg_match('/\[img\](.*?)\[\/img\]/i',$post["pagetext"],$matches);
$query = "UPDATE `thread` set `thumbnailurl` = '".$db->escape_string($matches[1])."' WHERE threadid = " . $thread["threadid"];
echo "
<b>SQL:</b>".$query."<br><br>";
$db->query_write($query);
}
?>