Status
Not open for further replies.

Jester

Customer
Hello gentlemen,

I have been having a persistent issue with forumrunner visitors on the site listed in the problem description. I have been getting multiple DB error emails every day since starting that site. Since the error only occurs in forumrunner I was in contact with vbulletin and forumrunner support. It was determined that disabling vbcredits solves the error. The exact same issue also happens on my recently upgraded site which is much busier and I get many more error emails now.

The DB error:

Code:
Database error in vBulletin 4.2.0:

Invalid SQL:

					SELECT attachmentid, attachment.userid, filesize, thread.forumid
					FROM attachment AS attachment
					LEFT JOIN post AS post ON (post.postid = attachment.postid)
					LEFT JOIN thread AS thread ON (post.threadid = thread.threadid)
					WHERE attachmentid =;

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 '' at line 5
Error Number  : 1064
Request Date  : Wednesday, January 16th 2013 @ 11:25:52 AM
Error Date    : Wednesday, January 16th 2013 @ 11:25:52 AM
Script        : http://xxxxxx.xxxxxxx.com/forums/forumrunner/request.php
Referrer      : 
IP Address    : 
Username      : Jester
Classname     : vB_Database_MySQLi
MySQL Version : 5.2.11-MariaDB-mariadb115

As mentioned, I do not get the error when vbcredits is disabled.
 
I believe this has already been fixed in a hotfix, can you try re-downloading and re-uploading the mod?
 
Sorry, for some reason the fix for this issue had been reverted from the live file.

The modified file is /dbtech/credits/credits_vbulletin.php :)
 

Did as you said, same error.


Database error in vBulletin 4.2.0:

Invalid SQL:

SELECT attachmentid, attachment.userid, filesize, thread.forumid
FROM attachment AS attachment
LEFT JOIN post AS post ON (post.postid = attachment.postid)
LEFT JOIN thread AS thread ON (post.threadid = thread.threadid)
WHERE attachmentid =;

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 '' at line 5
Error Number : 1064
Request Date : Wednesday, January 16th 2013 @ 01:20:54 PM
Error Date : Wednesday, January 16th 2013 @ 01:20:55 PM
 
Are you sure you're downloading v2.1? I'm looking at the code and with the edits it's impossible for that error to still occur.

Check that line 145 in your credits_vbulletin.php file looks like this:
PHP:
if (!$vbulletin->GPC['thumb'] AND ($vbulletin->GPC['attachmentid'] OR $vbulletin->GPC['postid']))
 
Are you sure you're downloading v2.1? I'm looking at the code and with the edits it's impossible for that error to still occur.

Check that line 145 in your credits_vbulletin.php file looks like this:
PHP:
if (!$vbulletin->GPC['thumb'] AND ($vbulletin->GPC['attachmentid'] OR $vbulletin->GPC['postid']))

I checked the file on the server and the file I downloaded. In both line #145 is:

}

File I'm looking is is dated 1 hour ago

/*=======================================================================*\
|| ##################################################################### ||
|| # vBCredits II Deluxe 2.1.0 - `credits_vbulletin.php` # ||
|| # ------------------------------------------------------------------# ||
|| # Author: Darkwaltz4 {blackwaltz4@msn.com} # ||
|| # Copyright © 2009 - 2012 John Jakubowski. All Rights Reserved. # ||
|| # This file may not be redistributed in whole or significant part. # ||
|| # -----------------vBulletin IS NOT FREE SOFTWARE!------------------# ||
|| # Support: http://www.dragonbyte-tech.com/ # ||
|| ##################################################################### ||
\*=======================================================================*/

require_once(DIR . '/includes/functions_misc.php');

class VBCREDITS_VBULLETIN
 
Please search for the string
Code:
if (!$vbulletin->GPC['thumb']
and tell me what the line that string appears on reads like compared to the above.
 
Please search for the string
Code:
if (!$vbulletin->GPC['thumb']
and tell me what the line that string appears on reads like compared to the above.

function download()
{
global $vbulletin, $db, $attach;

if (!$vbulletin->GPC['thumb'])
{ //not thumbnail view
if (empty($attach))
{ //vb3.x
$attachmentinfo = $db->query_first_slave("
SELECT attachmentid, attachment.userid, filesize, thread.forumid
FROM " . TABLE_PREFIX . "attachment AS attachment
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = attachment.postid)
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
WHERE " . ($vbulletin->GPC['postid'] ? "attachment.postid = " . $vbulletin->GPC['postid'] : "attachmentid = " . $vbulletin->GPC['attachmentid'])
);
}
else if (array_pop(explode('_', strtolower(get_class($attach)))) == 'post')
{ //vb4.x
$attachmentinfo = $db->query_first_slave("
SELECT a.attachmentid, fd.userid, fd.filesize, thread.forumid
FROM " . TABLE_PREFIX . "attachment AS a
INNER JOIN " . TABLE_PREFIX . "filedata AS fd ON (a.filedataid = fd.filedataid)
LEFT JOIN " . TABLE_PREFIX . "post AS post ON (post.postid = a.contentid)
LEFT JOIN " . TABLE_PREFIX . "thread AS thread ON (post.threadid = thread.threadid)
WHERE a.attachmentid = " . $vbulletin->GPC['attachmentid']
);
}
if ($attachmentinfo)
{ //only forum attachments
$extra = array('forumid' => $$attachmentinfo['forumid'], 'multiplier' => $attachmentinfo['filesize'], 'ownerid' => $attachmentinfo['userid']);
VBCREDITS::action('download', $vbulletin->userinfo['userid'], $attachmentinfo['attachmentid'], false, $extra);
if ($vbulletin->userinfo['userid'] != $attachmentinfo['userid'] AND ($vbulletin->userinfo['userid'] OR $vbulletin->options['credits_guest_views'])) VBCREDITS::action('downloaded', $attachmentinfo['userid'], $attachmentinfo['attachmentid'], false, $extra);
}
}
}
 
So it's not the updated file then.

Please change
PHP:
if (!$vbulletin->GPC['thumb'])

To
PHP:
if (!$vbulletin->GPC['thumb'] AND ($vbulletin->GPC['attachmentid'] OR $vbulletin->GPC['postid']))

And then save it :)
 
Update: I see the issue with the download, it doesn't follow our internal standards for how to separate Lite and Pro downloads, so I had only patched the Lite version, not the Pro version.

Sorry about that :(
 
Update: I see the issue with the download, it doesn't follow our internal standards for how to separate Lite and Pro downloads, so I had only patched the Lite version, not the Pro version.

Sorry about that :(

It's fixed now. Thank you for your time. (still waiting on that email from you)
 
I'm scrambling to finish vBDownloads v1.4 for Friday so I haven't had much time to plan and get a quote on that ready, sorry :(
 
Status
Not open for further replies.

Legacy vBCredits II Deluxe

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
846
Customer rating
0.00 star(s) 0 ratings
Back
Top