I have just updated my forums to the newest update, and my members run into an error when they post a new post.
Fatal error: Call to a member function on a non-object in /home/rpg-game/public_html/forum/newreply.php on line <b>340
I don't undertand what the problem is though.
PHP Code:
// ### POST HAS ERRORS ###
$postpreview = construct_errors($errors); // this will take the preview's place
construct_checkboxes($newpost);
$_REQUEST['do'] = 'newreply';
$newpost['message'] = htmlspecialchars_uni($newpost['message']);
}
else if ($newpost['preview'])
{
if ($forumperms & $vbulletin->bf_ugp_forumpermissions['canpostattachment'] AND $vbulletin->userinfo['userid'])
{
// Attachments added
$attachs = $db->query_read("
SELECT dateline, thumbnail_dateline, filename, filesize, visible, attachmentid, counter,
IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail, thumbnail_filesize,
attachmenttype.thumbnail AS build_thumbnail, attachmenttype.newwindow
FROM " . TABLE_PREFIX . "attachment AS attachment
LEFT JOIN " . TABLE_PREFIX . "attachmenttype AS attachmenttype USING (extension)
WHERE posthash = '" . $db->escape_string($posthash) . "'
AND userid = " . $vbulletin->userinfo['userid'] . "
ORDER BY attachmentid
");
while ($attachment = $db->fetch_array($attachs))
{
if (!$attachment['build_thumbnail'])
{
$attachment['hasthumbnail'] = false;
}
$postattach["$attachment[attachmentid]"] = $attachment;
}
}
that is the code block for the error message. the bold is the line that was called. can anyone help me with this? thanks.
Also is there a way that I can fix this with stripping my board of everything?