<?php
/**
- * NP_SpamBayes(JP) ($Revision: 1.2 $)
+ * NP_SpamBayes(JP) ($Revision: 1.3 $)
* by hsur ( http://blog.cles.jp/np_cles )
- * $Id: NP_SpamBayes.php,v 1.2 2007-06-22 16:40:20 hsur Exp $
+ * $Id: NP_SpamBayes.php,v 1.3 2007-06-23 04:13:01 hsur Exp $
*
* Copyright (C) 2007 cles All rights reserved.
*/
function getName() { return 'SpamBayes(JP)'; }
function getAuthor() { return 'xiffy + hsur'; }
function getURL() { return 'http://blog.cles.jp/np_cles/category/31/subcatid/17'; }
- function getVersion() { return '1.1.0 jp1.2b'; }
+ function getVersion() { return '1.1.0 jp1.3b'; }
function getDescription() { return 'SpamBayes filter for comment and trackback spam. In adherence with Spam API 1.0 for Nucleus'; }
function supportsFeature($what) {
switch($what) {
// now train spam bayes with all current trackbacks as ham!!
$res = sql_query("select * from ".sql_table('plugin_tb').' where block = 0');
while ($arr = mysql_fetch_array($res)) {
- $oPluginAdmin->plugin->spambayes->train($arr['id']+1000000000, 'ham', $arr['title'].' '.$arr['excerpt'].' '.$arr['blog_name'].' '.$arr['url']);
+ $oPluginAdmin->plugin->spambayes->train($arr['id']+100000000, 'ham', $arr['title'].' '.$arr['excerpt'].' '.$arr['blog_name'].' '.$arr['url']);
}
$oPluginAdmin->plugin->spambayes->updateProbabilities();
}
// now train spam bayes with all current trackbacks as ham!!
$res = sql_query("select * from ".sql_table('plugin_tb').' where block = 0');
while ($arr = mysql_fetch_array($res)) {
- $oPluginAdmin->plugin->spambayes->trainnew($arr['id']+1000000000, 'ham', $arr['title'].' '.$arr['excerpt'].' '.$arr['blog_name'].' '.$arr['url']);
+ $oPluginAdmin->plugin->spambayes->trainnew($arr['id']+100000000, 'ham', $arr['title'].' '.$arr['excerpt'].' '.$arr['blog_name'].' '.$arr['url']);
}
$oPluginAdmin->plugin->spambayes->updateProbabilities();
}
}
function nextdocid() {
- $res = sql_query ("select ref from ".$this->table_ref." order by ref desc limit 0,1");
- $obj = mysql_fetch_object($res);
- if ($obj->ref >= 1000000) {
+ $res = sql_query ("select ref from ".$this->table_ref." where ref > 500000000 order by ref desc limit 0,1");
+ $obj = @ mysql_fetch_object($res);
+ if ($obj) {
return $obj->ref + 1;
} else {
- return 1000000;
+ return 500000000;
}
}