From 42b71213471a52e27b3ca317ec9fd4c19e55cbf4 Mon Sep 17 00:00:00 2001 From: Cameron Date: Fri, 9 Feb 2018 10:08:36 -0800 Subject: [PATCH] Issue #3030 NewForumPosts "main" BC Fix for top/bottom position. --- e107_plugins/news/news.php | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php index 2e5ad0465..72774dbd0 100644 --- a/e107_plugins/news/news.php +++ b/e107_plugins/news/news.php @@ -90,9 +90,31 @@ class news_front return null; } + if(!empty($this->pref['nfp_display']) && intval($this->pref['nfp_display']) === 1) // top position + { + $this->text .= $this->renderNewForumPosts(); + } + $this->text .= $this->renderDefaultTemplate(); - // BC replacement for newforumposts_main + if(!empty($this->pref['nfp_display']) && intval($this->pref['nfp_display']) === 2) // bottom position + { + $this->text .= $this->renderNewForumPosts(); + } + + $this->text .= $this->show_newsarchive(); + $this->text .= $this->render_newscats(); + return null; + + } + + + /** + * BC replacement for newforumposts_main + * @return string + */ + private function renderNewForumPosts() + { if(e107::isInstalled('newforumposts_main') && !empty($this->pref['nfp_display'])) { $parms = array('layout'=>'main', 'display'=>$this->pref['nfp_amount']); @@ -102,18 +124,13 @@ class news_front $parms['scroll'] = $this->pref['nfp_layer_height']; } - $this->text .= e107::getMenu()->renderMenu('forum','newforumposts_menu', $parms, true); + return e107::getMenu()->renderMenu('forum','newforumposts_menu', $parms, true); } - $this->text .= $this->show_newsarchive(); - $this->text .= $this->render_newscats(); - return null; - } - private function getRenderId() { $tmp = explode('/',$this->route);