From 4947c02e1a035659706a255ab5957e4dabafab87 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Wed, 17 Jun 2015 17:00:36 +0300 Subject: [PATCH] show article count in bayes stats --- plugins/af_sort_bayes/init.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/af_sort_bayes/init.php b/plugins/af_sort_bayes/init.php index 95812768..7699d2c4 100644 --- a/plugins/af_sort_bayes/init.php +++ b/plugins/af_sort_bayes/init.php @@ -170,10 +170,13 @@ class Af_Sort_Bayes extends Plugin { print "
"; - $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 ""; - print ""; + print ""; while ($line = $this->dbh->fetch_assoc($result)) { print ""; -- 2.39.5
CategoryProbabilityWord count
CategoryProbabilityWord countArticle count