I did as you recomended but maybe I am doing it wrong here is what my code looks like:
$forumids = substr($forumids, 1);
$attachments = $DB_site->query_first("
SELECT COUNT(*) AS total,
SUM(filesize) AS sum
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)
LEFT JOIN " . TABLE_PREFIX . "deletionlog AS deletionlog ON(attachment.postid = deletionlog.primaryid AND type = 'post')
WHERE attachment.userid = $userid
AND ((forumid IN ($forumids) AND thread.visible = 1 AND post.visible = 1 AND deletionlog.primaryid IS NULL) " . iif($userid==$bbuserinfo['userid'], "OR attachment.postid = 0") . ")
");
Am I supposed to replace the line of:
$forumids .= ",$forumid";
with:
$forumids = substr($forumids, 1);
I am not really sure where I am supposed to add this line or if it is supposed to replace another line. I have tried it both ways and still get the error.
|