Helpful Information
 
 
Category: Advanced Warning System (AWS)
custom ban message problem

hi people,

whenever i enable the so "called" custom ban message i get a MySQL crash after a banned member logs into my forums


Database error in vBulletin 3.0.7:

Invalid SQL:
SELECT

thread.threadid, thread.title, thread.replycount, postusername, postuserid, thread.dateline AS postdateline, IF(views <= thread.replycount, thread.replycount+1, views) AS views, thread.lastposter, thread.lastpost, pollid
, thread.iconid AS threadiconid, iconpath AS threadiconpath
,thread.forumid, forum.title AS forumtitle
, post.pagetext AS preview
, NOT ISNULL(subscribethread.subscribethreadid) AS subscribed
FROM vb3_thread as thread
LEFT JOIN vb3_icon USING (iconid)
LEFT JOIN vb3_forum AS forum ON (thread.forumid = forum.forumid)
LEFT JOIN vb3_post AS post ON (post.postid = thread.firstpostid)
LEFT JOIN vb3_deletionlog AS deletionlog ON (thread.threadid = deletionlog.primaryid AND type = 'thread')
LEFT JOIN vb3_subscribethread AS subscribethread ON (subscribethread.threadid = thread.threadid AND subscribethread.userid = 13)
WHERE open <> '10' AND thread.visible = 1 AND thread.forumid NOT IN(7,8,32,33,9,10,11,12,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,34,29,30,35 ,36,37) Array AND deletionlog.primaryid IS NULL
ORDER BY lastpost DESC
LIMIT 10

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Array AND deletionlog.primaryid IS NULL
ORDER BY lastpost D

mysql error number: 1064

Date: Sunday 20th of March 2005 11:36:09 PM
Script: http://www.myserver.com
Referer:
Username: ********
IP Address: ********


*any* idea what could be wrong here

You haven't edited the file includes/functions.php properly. This is where the check is done. This is how it looks in my site.


$postvars = construct_post_vars_html();

$bbuserinfo['badlocation'] = 1; // Used by exec_shut_down();

// Apply this for special message for banned users.
if (($bbuserinfo['usergroupid']==$vboptions['warn_banned_usergroup_id'] OR $bbuserinfo['usergroupid']==$vboptions['warn_troll_usergroup_id']) AND $bbuserinfo['userid'])
{
$ban = $DB_site->query_first("SELECT liftdate FROM " . TABLE_PREFIX . "userban WHERE userid=$bbuserinfo[userid]");
if ($ban['liftdate']=='0')
{
$until="permanently banned";
}
else
{
$until= vbdate ( $vboptions['dateformat'], $ban[liftdate] ) ;
$until=" temporarily banned, until the $until";
}
eval(print_standard_error('nopermission_banned', true));
}

if ($bbuserinfo['userid'])
{
eval(print_standard_error('nopermission_loggedin', true));
}
else
{
$scriptpath = htmlspecialchars_uni(SCRIPTPATH);

define('VB_ERROR_PERMISSION', true);

eval(print_standard_error('nopermission_loggedout', false));
}


Rgds

thanks John solved & working i must have overlooked something there

Most welcome










privacy (GDPR)