From 26f9cc87526b52e86d881493a65ef6096db74014 Mon Sep 17 00:00:00 2001 From: Krivchikov Dmitry Date: Fri, 8 Apr 2016 16:52:31 +0300 Subject: [PATCH] =?UTF-8?q?ADD=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D1=82=D0=B0=D1=80=D0=B8=D0=B8=20=D0=B2=20=D0=BA=D0=BE=D0=B4?= =?UTF-8?q?=D0=B5;=20=D0=A3=D1=82=D0=BE=D1=87=D0=BD=D0=B8=D0=BB=20=D0=B2?= =?UTF-8?q?=D1=8B=D0=B1=D0=BE=D1=80=D0=BA=D1=83=20=D1=82=D0=BE=D1=87=D0=B5?= =?UTF-8?q?=D0=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.php | 3 +++ classes/Helper.php | 6 +++--- controllers/FeedController.php | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app.php b/app.php index 1f3446a..2f3e7b2 100644 --- a/app.php +++ b/app.php @@ -93,6 +93,9 @@ class App } } + /** + * @return null|PDO + */ public static function DB() { if (self::$DB === NULL && self::getConfig('DB')) { diff --git a/classes/Helper.php b/classes/Helper.php index 0bffc85..c8cb93e 100644 --- a/classes/Helper.php +++ b/classes/Helper.php @@ -10,9 +10,9 @@ class Helper /** * TYPES: 'clear','html', 'editor','js' - * @param type $string - * @param type $replaceType - * @return type + * @param string $string + * @param string $replaceType + * @return string */ public static function replaceLinks($string, $replaceType = 'clear') { diff --git a/controllers/FeedController.php b/controllers/FeedController.php index ef5ecd8..9de2993 100644 --- a/controllers/FeedController.php +++ b/controllers/FeedController.php @@ -55,7 +55,7 @@ class FeedController extends Controller // --------- AUTHORS $authors = array(); - $authorIds = App::DB()->query('SELECT `author` , COUNT( * ) `cnt` FROM `points` GROUP BY `author` ORDER BY `cnt` DESC LIMIT 0 , 6')->fetchAll(PDO::FETCH_ASSOC); + $authorIds = App::DB()->query('SELECT `author` , COUNT( * ) `cnt` FROM `points` WHERE `moderate`=1 GROUP BY `author` ORDER BY `cnt` DESC LIMIT 0 , 6')->fetchAll(PDO::FETCH_ASSOC); foreach ($authorIds as $authorId) { $author = User::model()->getByPK($authorId['author']); $author->pointsCount = $authorId['cnt'];