diff --git a/controllers/FeedController.php b/controllers/FeedController.php index d860fa0..ab3019d 100644 --- a/controllers/FeedController.php +++ b/controllers/FeedController.php @@ -22,7 +22,7 @@ class FeedController extends Controller // --------- POINTS $points = Point::model()->getAll(array( - 'where' => '`status` = "published"', + 'where' => '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')', 'order' => '`ord` DESC', 'limit' => 5, )); diff --git a/controllers/PageController.php b/controllers/PageController.php index 5ee3c3c..a54fa25 100644 --- a/controllers/PageController.php +++ b/controllers/PageController.php @@ -44,7 +44,7 @@ class PageController extends Controller // ------------------------------------------ $param = array(); - $param['where'] = '`status` = "published"'; + $param['where'] = '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')'; $pointsCount = Point::model()->getCount($param); $pagesCount = intval(ceil($pointsCount/self::elementsByPage)); $page = isset($_GET['page']) ? abs((int)$_GET['page']) : $pagesCount; @@ -81,7 +81,7 @@ class PageController extends Controller } else if (App::getParam('user')) { $param['where'] = '`author` = ' . (int) App::getParam('user') . ' AND `status` = "published"'; } else { - $param['where'] = '`status` = "published"'; + $param['where'] = '`status` = "published" AND `categoryId` NOT IN ('. implode(',', Category::$paidIds).')'; $param['limit'] = self::elementsByPage; if($page) { $param['offset'] = self::elementsByPage * ($pagesCount - $page); diff --git a/models/Category.php b/models/Category.php index 56e84ad..7de1ccc 100644 --- a/models/Category.php +++ b/models/Category.php @@ -3,7 +3,7 @@ class Category extends Model { private static $categories = NULL; - private static $paidIds = array(24,25); + public static $paidIds = array(24,25); function __construct($fromArray = array()) {