diff --git a/public/include/pages/statistics/pool.inc.php b/public/include/pages/statistics/pool.inc.php index e5212938..0c9c2eb7 100644 --- a/public/include/pages/statistics/pool.inc.php +++ b/public/include/pages/statistics/pool.inc.php @@ -9,7 +9,7 @@ if ($bitcoin->can_connect() === true){ $dDifficulty = $bitcoin->getdifficulty(); $iBlock = $bitcoin->getblockcount(); } else { - $iDifficulty = 1; + $dDifficulty = 1; $iBlock = 0; $_SESSION['POPUP'][] = array('CONTENT' => 'Unable to connect to litecoind RPC service: ' . $bitcoin->can_connect(), 'TYPE' => 'errormsg'); } diff --git a/public/include/smarty_globals.inc.php b/public/include/smarty_globals.inc.php index 8c7891e6..f34b3b4a 100644 --- a/public/include/smarty_globals.inc.php +++ b/public/include/smarty_globals.inc.php @@ -29,18 +29,20 @@ $aGlobal = array( ); // We don't want these session infos cached -$aGlobal['userdata'] = $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array(); -$aGlobal['userdata']['balance'] = $transaction->getBalance($_SESSION['USERDATA']['id']); +if (@$_SESSION['USERDATA']['id']) { + $aGlobal['userdata'] = $_SESSION['USERDATA']['id'] ? $user->getUserData($_SESSION['USERDATA']['id']) : array(); + $aGlobal['userdata']['balance'] = $transaction->getBalance($_SESSION['USERDATA']['id']); -// Other userdata that we can cache savely -$aGlobal['userdata']['shares'] = $statistics->getUserShares($_SESSION['USERDATA']['id']); -$aGlobal['userdata']['hashrate'] = $statistics->getUserHashrate($_SESSION['USERDATA']['id']); + // Other userdata that we can cache savely + $aGlobal['userdata']['shares'] = $statistics->getUserShares($_SESSION['USERDATA']['id']); + $aGlobal['userdata']['hashrate'] = $statistics->getUserHashrate($_SESSION['USERDATA']['id']); -// Some estimations -$aGlobal['userdata']['est_block'] = round(( (int)$aGlobal['userdata']['shares']['valid'] / (int)$aRoundShares['valid'] ) * (int)$config['reward'], 3); -$aGlobal['userdata']['est_fee'] = round(($config['fees'] / 100) * $aGlobal['userdata']['est_block'], 3); -$aGlobal['userdata']['est_donation'] = round((( $aGlobal['userdata']['donate_percent'] / 100) * ($aGlobal['userdata']['est_block'] - $aGlobal['userdata']['est_fee'])), 3); -$aGlobal['userdata']['est_payout'] = round($aGlobal['userdata']['est_block'] - $aGlobal['userdata']['est_donation'] - $aGlobal['userdata']['est_fee'], 3); + // Some estimations + $aGlobal['userdata']['est_block'] = round(( (int)$aGlobal['userdata']['shares']['valid'] / (int)$aRoundShares['valid'] ) * (int)$config['reward'], 3); + $aGlobal['userdata']['est_fee'] = round(($config['fees'] / 100) * $aGlobal['userdata']['est_block'], 3); + $aGlobal['userdata']['est_donation'] = round((( $aGlobal['userdata']['donate_percent'] / 100) * ($aGlobal['userdata']['est_block'] - $aGlobal['userdata']['est_fee'])), 3); + $aGlobal['userdata']['est_payout'] = round($aGlobal['userdata']['est_block'] - $aGlobal['userdata']['est_donation'] - $aGlobal['userdata']['est_fee'], 3); +} // Make it available in Smarty $smarty->assign('PATH', 'site_assets/' . THEME); diff --git a/public/templates/mmcFE/account/transactions/default.tpl b/public/templates/mmcFE/account/transactions/default.tpl index ed523e54..8f5282e1 100644 --- a/public/templates/mmcFE/account/transactions/default.tpl +++ b/public/templates/mmcFE/account/transactions/default.tpl @@ -77,7 +77,7 @@ {/section} Unconfirmed Totals: - {$credits - $debits} + {$credits|default - $debits|default} @@ -121,7 +121,7 @@ {/section} Orphaned Totals: - {$orphan_credits - $orphan_debits} + {$orphan_credits|default - $orphan_debits|default} diff --git a/public/templates/mmcFE/global/block_header.tpl b/public/templates/mmcFE/global/block_header.tpl index b6b85403..49eed72d 100644 --- a/public/templates/mmcFE/global/block_header.tpl +++ b/public/templates/mmcFE/global/block_header.tpl @@ -1,9 +1,9 @@ -
+

{$BLOCK_HEADER|default:"UNKNOWN BLOCK"}

- {if $BUTTONS} + {if $BUTTONS|default}
    {foreach from=$BUTTONS item=name}
  • {$name}
  • @@ -11,4 +11,4 @@
{/if}
-
+
diff --git a/public/templates/mmcFE/global/motd.tpl b/public/templates/mmcFE/global/motd.tpl index c95e7278..cbb918cd 100644 --- a/public/templates/mmcFE/global/motd.tpl +++ b/public/templates/mmcFE/global/motd.tpl @@ -1,4 +1,4 @@ -{if $GLOBAL.motd} +{if $GLOBAL.motd|default}
***Message of the Day***
{$GLOBAL.motd|escape:'html'} diff --git a/public/templates/mmcFE/global/navigation.tpl b/public/templates/mmcFE/global/navigation.tpl index 62c24dbd..3830006b 100644 --- a/public/templates/mmcFE/global/navigation.tpl +++ b/public/templates/mmcFE/global/navigation.tpl @@ -1,6 +1,6 @@
  • News
  • - {if $smarty.session.AUTHENTICATED == 1}
  • Logout
  • {else}
  • Register
  • {/if} + {if $smarty.session.AUTHENTICATED|default == 1}
  • Logout
  • {else}
  • Register
  • {/if} diff --git a/public/templates/mmcFE/global/userinfo.tpl b/public/templates/mmcFE/global/userinfo.tpl index b4836be3..01b095f2 100644 --- a/public/templates/mmcFE/global/userinfo.tpl +++ b/public/templates/mmcFE/global/userinfo.tpl @@ -1,4 +1,4 @@ -{if $GLOBAL.userdata.username} +{if $GLOBAL.userdata.username|default}

    Welcome, {$smarty.session.USERDATA.username} Active Account: {$GLOBAL.fees}% Pool Fee (You are donating {$GLOBAL.userdata.donate_percent}% of your earnings)

    {else}

    Welcome guest, please register to user this pool.

    diff --git a/public/templates/mmcFE/master.tpl b/public/templates/mmcFE/master.tpl index 14aa2e56..aff628f4 100644 --- a/public/templates/mmcFE/master.tpl +++ b/public/templates/mmcFE/master.tpl @@ -4,7 +4,7 @@ ThePool - + @@ -45,14 +45,14 @@