]> git.wh0rd.org Git - tt-rss.git/commitdiff
show article count in bayes stats
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 17 Jun 2015 14:00:36 +0000 (17:00 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Wed, 17 Jun 2015 14:00:36 +0000 (17:00 +0300)
plugins/af_sort_bayes/init.php

index 958127689f6ea0b3742f1b57989b45a083fc86e0..7699d2c4ddee708d36617682d04e213159a238c3 100644 (file)
@@ -170,10 +170,13 @@ class Af_Sort_Bayes extends Plugin {
 
                print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__('Bayesian classifier (af_sort_bayes)')."\">";
 
-               $result = $this->dbh->query("SELECT category, probability, word_count FROM {$this->sql_prefix}_categories WHERE owner_uid = " . $_SESSION["uid"]);
+               $result = $this->dbh->query("SELECT category, probability, word_count,
+                       (SELECT COUNT(id) FROM {$this->sql_prefix}_references WHERE
+                               category_id = {$this->sql_prefix}_categories.id) as doc_count
+                       FROM {$this->sql_prefix}_categories WHERE owner_uid = " . $_SESSION["uid"]);
 
                print "<table>";
-               print "<tr><th>Category</th><th>Probability</th><th>Word count</th></tr>";
+               print "<tr><th>Category</th><th>Probability</th><th>Word count</th><th>Article count</th></tr>";
 
                while ($line = $this->dbh->fetch_assoc($result)) {
                        print "<tr>";