mirror of
https://github.com/e107inc/e107.git
synced 2025-08-05 06:07:32 +02:00
More debug info added.
This commit is contained in:
@@ -36,6 +36,7 @@ class news_front
|
|||||||
private $newsUrlparms = array();
|
private $newsUrlparms = array();
|
||||||
private $text = null;
|
private $text = null;
|
||||||
private $pref = array();
|
private $pref = array();
|
||||||
|
private $debugInfo = array();
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
@@ -266,20 +267,38 @@ class news_front
|
|||||||
public function debug()
|
public function debug()
|
||||||
{
|
{
|
||||||
echo "<div class='alert alert-info'>";
|
echo "<div class='alert alert-info'>";
|
||||||
echo "<h4>SEF Debug Info</h4>";
|
echo "<h4>News Debug Info</h4>";
|
||||||
echo "action= ".$this->action." ";
|
echo "<b>action:</b> ".$this->action." ";
|
||||||
echo "<br />subaction= ".$this->subAction." ";
|
echo "<br /><b>subaction:</b> ".$this->subAction." ";
|
||||||
echo "<br />route= ".$this->route." ";
|
echo "<br /><b>route</b> ".$this->route." ";
|
||||||
echo "<br />e_QUERY= ".e_QUERY." ";
|
echo "<br /><b>e_QUERY:</b> ".e_QUERY." ";
|
||||||
|
|
||||||
|
echo "<br /><b>_GET:</b> ".print_r($_GET,true);
|
||||||
|
|
||||||
|
foreach($this->debugInfo as $key=>$val)
|
||||||
|
{
|
||||||
|
echo "<br /><b>".$key.":</b> ".$val;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
echo "<br />_GET= ".print_r($_GET,true);
|
|
||||||
echo "</div>";
|
echo "</div>";
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
private function addDebug($key,$message)
|
||||||
|
{
|
||||||
|
if(is_array($message))
|
||||||
|
{
|
||||||
|
$this->debugInfo[$key] = print_a($message,true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$this->debugInfo[$key] = $message;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
// ----------- old functions ------------------------
|
// ----------- old functions ------------------------
|
||||||
|
|
||||||
@@ -553,7 +572,7 @@ class news_front
|
|||||||
|
|
||||||
private function renderListTemplate()
|
private function renderListTemplate()
|
||||||
{
|
{
|
||||||
|
$this->addDebug("Method",'renderListTemplate()');
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
|
|
||||||
@@ -823,11 +842,13 @@ class news_front
|
|||||||
|
|
||||||
private function renderViewTemplate()
|
private function renderViewTemplate()
|
||||||
{
|
{
|
||||||
|
$this->addDebug("Method",'renderViewTemplate()');
|
||||||
|
|
||||||
if($newsCachedPage = checkCache($this->cacheString))
|
if($newsCachedPage = checkCache($this->cacheString))
|
||||||
{
|
{
|
||||||
$rows = getNewsCache($this->cacheString,'rows');
|
$rows = $this->getNewsCache($this->cacheString,'rows');
|
||||||
e107::getEvent()->trigger('user_news_item_viewed', $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
|
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
|
$id = $news['news_category']; // Use category of this news item to generate next/prev links
|
||||||
|
|
||||||
e107::getEvent()->trigger('user_news_item_viewed', $news);
|
e107::getEvent()->trigger('user_news_item_viewed', $news);
|
||||||
|
$this->addDebug("Event-triggered:user_news_item_viewed", $news);
|
||||||
|
|
||||||
//***NEW [SecretR] - comments handled inside now
|
//***NEW [SecretR] - comments handled inside now
|
||||||
e107::setRegistry('news/page_allow_comments', !$news['news_allow_comments']);
|
e107::setRegistry('news/page_allow_comments', !$news['news_allow_comments']);
|
||||||
@@ -978,6 +1000,7 @@ class news_front
|
|||||||
|
|
||||||
private function renderDefaultTemplate()
|
private function renderDefaultTemplate()
|
||||||
{
|
{
|
||||||
|
$this->addDebug("Method",'renderDefaultTemplate()');
|
||||||
$tp = e107::getParser();
|
$tp = e107::getParser();
|
||||||
$sql = e107::getDb();
|
$sql = e107::getDb();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user