news category browse lists/counts inactive 'draft' articles
Posted: Tue Apr 28, 2009 4:33 pm
If you create a category browse page for the news module, this will create a page which lists all the news categories and the number of articles in each category.
However, this numbering includes articles that have a status of 'draft' (i.e. articles which the front-end should not display).
As a very short-term solution to this one can edit modules/News/action.browsecat.php, around line 37:
from:
$q2 = "SELECT COUNT(news_id) as cnt FROM ".cms_db_prefix()."module_news WHERE news_category_id=?";
to
$q2 = "SELECT COUNT(news_id) as cnt FROM ".cms_db_prefix()."module_news WHERE news_category_id=? AND status != 'draft'";
Is this a feature or a bugĀ
However, this numbering includes articles that have a status of 'draft' (i.e. articles which the front-end should not display).
As a very short-term solution to this one can edit modules/News/action.browsecat.php, around line 37:
from:
$q2 = "SELECT COUNT(news_id) as cnt FROM ".cms_db_prefix()."module_news WHERE news_category_id=?";
to
$q2 = "SELECT COUNT(news_id) as cnt FROM ".cms_db_prefix()."module_news WHERE news_category_id=? AND status != 'draft'";
Is this a feature or a bugĀ
