[CLEANUP] More code cleanup for last notifications

This commit is contained in:
Sebastian Grewe 2014-03-01 13:44:04 +01:00
parent 6a5376eaec
commit 34079926e0
2 changed files with 5 additions and 5 deletions

View File

@ -56,7 +56,6 @@ $aGlobal = array(
'hashrate' => $iCurrentPoolHashrate, 'hashrate' => $iCurrentPoolHashrate,
'nethashrate' => $dNetworkHashrate, 'nethashrate' => $dNetworkHashrate,
'sharerate' => $iCurrentPoolShareRate, 'sharerate' => $iCurrentPoolShareRate,
'lastnotifications' => $iLastNotifications,
'workers' => $iCurrentActiveWorkers, 'workers' => $iCurrentActiveWorkers,
'roundshares' => $aRoundShares, 'roundshares' => $aRoundShares,
'fees' => $config['fees'], 'fees' => $config['fees'],
@ -130,7 +129,8 @@ $aGlobal['acl']['chat']['page'] = $setting->getValue('acl_chat_page', 2);
// We don't want these session infos cached // We don't want these session infos cached
if (@$_SESSION['USERDATA']['id']) { if (@$_SESSION['USERDATA']['id']) {
// Fetch Last 5 notifications // Fetch Last 5 notifications
$iLastNotifications = $notification->getNofifications($_SESSION['USERDATA']['id'], 5); $aLastNotifications = $notification->getNofifications($_SESSION['USERDATA']['id'], 5);
$aGlobal['userdata']['lastnotifications'] = $aLastNotifications;
$aGlobal['userdata'] = $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array(); $aGlobal['userdata'] = $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array();
$aGlobal['userdata']['balance'] = $transaction->getBalance($_SESSION['USERDATA']['id']); $aGlobal['userdata']['balance'] = $transaction->getBalance($_SESSION['USERDATA']['id']);

View File

@ -11,7 +11,7 @@
<!-- /.navbar-header --> <!-- /.navbar-header -->
<ul class="nav navbar-top-links navbar-right"> <ul class="nav navbar-top-links navbar-right">
{if $smarty.session.AUTHENTICATED|default:"0" == 1 && $GLOBAL.lastnotifications|@count != 0} {if $smarty.session.AUTHENTICATED|default:"0" == 1 && $GLOBAL.userdata.lastnotifications|@count|default:"0" != 0}
<!-- /.dropdown --> <!-- /.dropdown -->
<li class="dropdown"> <li class="dropdown">
<a class="dropdown-toggle" data-toggle="dropdown" href="#"> <a class="dropdown-toggle" data-toggle="dropdown" href="#">
@ -20,7 +20,7 @@
<ul class="dropdown-menu dropdown-alerts"> <ul class="dropdown-menu dropdown-alerts">
{section notification $GLOBAL.lastnotifications} {section notification $GLOBAL.userdata.lastnotifications}
<li> <li>
<a href="#"> <a href="#">
<div> <div>
@ -74,4 +74,4 @@
<!-- /.navbar-top-links --> <!-- /.navbar-top-links -->
</nav> </nav>
<!-- /.navbar-static-top --> <!-- /.navbar-static-top -->