diff --git a/e107_plugins/news/news.php b/e107_plugins/news/news.php
index 64db37a7f..d086f4e3c 100644
--- a/e107_plugins/news/news.php
+++ b/e107_plugins/news/news.php
@@ -36,6 +36,7 @@ class news_front
private $newsUrlparms = array();
private $text = null;
private $pref = array();
+ private $debugInfo = array();
function __construct()
{
@@ -266,20 +267,38 @@ class news_front
public function debug()
{
echo "
";
- echo "
SEF Debug Info
";
- echo "action= ".$this->action." ";
- echo "
subaction= ".$this->subAction." ";
- echo "
route= ".$this->route." ";
- echo "
e_QUERY= ".e_QUERY." ";
+ echo "News Debug Info
";
+ echo "action: ".$this->action." ";
+ echo "
subaction: ".$this->subAction." ";
+ echo "
route ".$this->route." ";
+ echo "
e_QUERY: ".e_QUERY." ";
+
+ echo "
_GET: ".print_r($_GET,true);
+
+ foreach($this->debugInfo as $key=>$val)
+ {
+ echo "
".$key.": ".$val;
+ }
+
- echo "
_GET= ".print_r($_GET,true);
echo "";
}
+ private function addDebug($key,$message)
+ {
+ if(is_array($message))
+ {
+ $this->debugInfo[$key] = print_a($message,true);
+ }
+ else
+ {
+ $this->debugInfo[$key] = $message;
+ }
+ }
// ----------- old functions ------------------------
@@ -553,7 +572,7 @@ class news_front
private function renderListTemplate()
{
-
+ $this->addDebug("Method",'renderListTemplate()');
$sql = e107::getDb();
$tp = e107::getParser();
@@ -823,11 +842,13 @@ class news_front
private function renderViewTemplate()
{
+ $this->addDebug("Method",'renderViewTemplate()');
+
if($newsCachedPage = checkCache($this->cacheString))
{
- $rows = getNewsCache($this->cacheString,'rows');
+ $rows = $this->getNewsCache($this->cacheString,'rows');
e107::getEvent()->trigger('user_news_item_viewed', $rows);
-
+ $this->addDebug("Event-triggered:user_news_item_viewed", $rows);
return $this->renderCache($newsCachedPage, TRUE); // This exits if cache used
}
@@ -870,6 +891,7 @@ class news_front
$id = $news['news_category']; // Use category of this news item to generate next/prev links
e107::getEvent()->trigger('user_news_item_viewed', $news);
+ $this->addDebug("Event-triggered:user_news_item_viewed", $news);
//***NEW [SecretR] - comments handled inside now
e107::setRegistry('news/page_allow_comments', !$news['news_allow_comments']);
@@ -978,6 +1000,7 @@ class news_front
private function renderDefaultTemplate()
{
+ $this->addDebug("Method",'renderDefaultTemplate()');
$tp = e107::getParser();
$sql = e107::getDb();