From b9bd7199006ac35bcf1ef7f85c92adfe717f2bf8 Mon Sep 17 00:00:00 2001 From: Cameron Date: Sat, 7 Feb 2015 23:43:21 -0800 Subject: [PATCH] Fixes #873 - Latest news Menu - hide brackets around comment count when comments are off. --- e107_handlers/news_class.php | 5 ++++- e107_plugins/news/templates/news_menu_template.php | 13 ++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/e107_handlers/news_class.php b/e107_handlers/news_class.php index deb7303eb..f57fb30a0 100644 --- a/e107_handlers/news_class.php +++ b/e107_handlers/news_class.php @@ -721,8 +721,11 @@ class e_news_tree extends e_front_tree_model $parser = e107::getParser(); $batch = e107::getScBatch('news') ->setScVar('param', $param); - + + $batch->wrapper('news_menu/latest'); //@SecretR - Please FIXME, I'm lost in here. (Cam) $i = 1; + + foreach ($this->getTree() as $news) { $vars->counter = $i; diff --git a/e107_plugins/news/templates/news_menu_template.php b/e107_plugins/news/templates/news_menu_template.php index 536b51486..2c2183da2 100644 --- a/e107_plugins/news/templates/news_menu_template.php +++ b/e107_plugins/news/templates/news_menu_template.php @@ -10,11 +10,8 @@ if (!defined('e107_INIT')) exit; global $sc_style; -$sc_style['NEWS_CATEGORY_NEWS_COUNT']['pre'] = '('; -$sc_style['NEWS_CATEGORY_NEWS_COUNT']['post'] = ')'; - - - +// $sc_style['NEWS_CATEGORY_NEWS_COUNT']['pre'] = '('; +// $sc_style['NEWS_CATEGORY_NEWS_COUNT']['post'] = ')'; @@ -24,6 +21,8 @@ $NEWS_MENU_TEMPLATE['category']['end'] = ''; $NEWS_MENU_TEMPLATE['category']['item'] = '
  • {NEWS_CATEGORY_TITLE} {NEWS_CATEGORY_NEWS_COUNT}
  • '; + +$NEWS_MENU_WRAPPER['category']['NEWS_CATEGORY_NEWS_COUNT'] = "({---})"; // Wrap brackets around the news count when value is returned. //$NEWS_MENU_TEMPLATE['category']['separator'] = '
    '; @@ -47,9 +46,9 @@ $NEWS_MENU_TEMPLATE['months']['item'] = ' // latest menu $NEWS_MENU_TEMPLATE['latest']['start'] = ''; // Example: $NEWS_MENU_TEMPLATE['latest']['end'] '
    {currentTotal} from {total}'; -$NEWS_MENU_TEMPLATE['latest']['item'] = '
  • {NEWSTITLE} ({NEWSCOMMENTCOUNT})
  • '; - +$NEWS_MENU_TEMPLATE['latest']['item'] = '
  • {NEWSTITLE} {NEWSCOMMENTCOUNT}
  • '; +$NEWS_MENU_WRAPPER['latest']['NEWSCOMMENTCOUNT'] = "({---})";