function akismet_mark_as_ham($postid) { $spamlog_check = $this->dbobject->query_first("SELECT * FROM " . TABLE_PREFIX . "spamlog WHERE postid = " . $postid); if (empty($spamlog_check)) { // Akismet doesn't appear to have really marked this as spam return; } $postdata = $this->dbobject->query_first("SELECT post.username AS username, post.pagetext AS pagetext, postlog.ip AS ip, postlog.useragent AS useragent FROM " . TABLE_PREFIX . "post AS post INNER JOIN " . TABLE_PREFIX . "postlog AS postlog ON(postlog.postid = post.postid) WHERE post.postid = " . $postid); if (!empty($postdata) and !empty($this->registry->options['vb_antispam_key'])) { require_once DIR . '/includes/class_akismet.php'; $akismet = new vB_Akismet($this->registry); $akismet->akismet_board = $this->registry->options['bburl']; $akismet->akismet_key = $this->registry->options['vb_antispam_key']; $akismet->mark_as_ham(array('user_ip' => $postdata['ip'], 'user_agent' => $postdata['useragent'], 'comment_type' => 'post', 'comment_author' => $postdata['username'], 'comment_content' => $postdata['pagetext'])); } $this->dbobject->query_write("DELETE FROM " . TABLE_PREFIX . "spamlog WHERE postid = " . $postid); }