OSDN Git Service

*** empty log message ***
authorhsur <hsur@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 23 Jun 2007 04:13:01 +0000 (04:13 +0000)
committerhsur <hsur@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 23 Jun 2007 04:13:01 +0000 (04:13 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/plugin@577 1ca29b6e-896d-4ea0-84a5-967f57386b96

trunk/NP_SpamBayes/NP_SpamBayes.php
trunk/NP_SpamBayes/spambayes/index.php
trunk/NP_SpamBayes/spambayes/spambayes.php

index 4f41a04..9170244 100644 (file)
@@ -1,9 +1,9 @@
 <?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.
 */
@@ -144,7 +144,7 @@ class NP_SpamBayes extends NucleusPlugin {
        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) {
index ed31486..7dc9e11 100644 (file)
                // 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();
        }
index 7f31a70..57018f7 100644 (file)
@@ -611,12 +611,12 @@ class NaiveBayesianStorage {
        }
 
        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;
                }
        }