The error message I'm seeing is:
Fatal error: Call to a member function query_write() on a non-object in
/home/usenetma/public_html/includes/functions_nntp.php on line
560
I'm working on updating the NNTP hack but I'm not quite sure whats up right now.
PHP Code:
function insert_post($threadid, $forumid, $foruminfo, $subject, $from_name, $from_email, $date, $parentid = 0)
{
global $DB_site, $message;
$db->query_write("INSERT INTO " . TABLE_PREFIX . "post
(postid, threadid, title, username, userid, dateline, pagetext,
allowsmilie, showsignature, ipaddress, iconid, visible,
isusenetpost, msgid, ref, parentid) VALUES
(NULL, $threadid, '". addslashes($subject) . "',
'" . addslashes($from_name) . "', 0, '" . $date . "',
'" . addslashes($message['text']) . "', 1, 0,
'" . addslashes($from_email) . "', 0, 1, 1,
'" . addslashes($message['message-id']) . "',
'" . addslashes($message['references']) . "', "
. $parentid . ")");
$postid=$db->insert_id();
//So that thread preview works
$db->query("UPDATE " . TABLE_PREFIX . "thread
SET firstpostid = $postid
WHERE threadid = $threadid");
//save attachments if any
if ($message['attachments']) {
process_attachments($date, $postid, $threadid, $forumid);
}
// Index post for searching
build_post_index($postid, $foruminfo);
return $postid;
}
line 560 is this one: $db->query_write("INSERT INTO " . TABLE_PREFIX . "post
Can anybody offer some tips on what this error means?