mirror of
https://github.com/e107inc/e107.git
synced 2025-08-01 04:10:38 +02:00
Issue #2785 - Fix for 'totals' in 'main' template footer.
This commit is contained in:
@@ -22,6 +22,7 @@ if(!class_exists('forum_newforumposts_menu'))
|
|||||||
private $plugPref = null;
|
private $plugPref = null;
|
||||||
private $menuPref = null;
|
private $menuPref = null;
|
||||||
private $forumObj = null;
|
private $forumObj = null;
|
||||||
|
private $total = array();
|
||||||
|
|
||||||
function __construct()
|
function __construct()
|
||||||
{
|
{
|
||||||
@@ -29,6 +30,16 @@ if(!class_exists('forum_newforumposts_menu'))
|
|||||||
$this->plugPref = e107::pref('forum'); // general forum preferences.
|
$this->plugPref = e107::pref('forum'); // general forum preferences.
|
||||||
$this->menuPref = e107::getMenu()->pref();// ie. popup config details from within menu-manager.
|
$this->menuPref = e107::getMenu()->pref();// ie. popup config details from within menu-manager.
|
||||||
|
|
||||||
|
$sql = e107::getDb();
|
||||||
|
|
||||||
|
$this->total['topics'] = $sql->count("forum_thread");
|
||||||
|
$this->total['replies'] = $sql->count("forum_post");
|
||||||
|
|
||||||
|
$sql->gen("SELECT sum(thread_views) as sum FROM #forum_thread");
|
||||||
|
$tmp = $sql->fetch();
|
||||||
|
$this->total['views'] = intval($tmp["sum"]);
|
||||||
|
|
||||||
|
|
||||||
$this->render();
|
$this->render();
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -190,10 +201,9 @@ if(!class_exists('forum_newforumposts_menu'))
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$TOTALS = array('TOTAL_TOPICS'=>$this->total['topics'], 'TOTAL_VIEWS'=>$this->total['views'], 'TOTAL_REPLIES'=>$this->total['replies']);
|
||||||
|
|
||||||
|
$list .= $tp->parseTemplate($template['end'], true, $TOTALS);
|
||||||
$list .= $tp->parseTemplate($template['end'], true, $sc);
|
|
||||||
|
|
||||||
|
|
||||||
$text = $list;
|
$text = $list;
|
||||||
}
|
}
|
||||||
@@ -222,6 +232,8 @@ if(!class_exists('forum_newforumposts_menu'))
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
new forum_newforumposts_menu;
|
new forum_newforumposts_menu;
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user