Display newspage on Mobile if not authed

* Do not show dashboard if user is not logged in
* Show news on Mobile and Desktop by default
* Show Dasboard on mobile once logged in
* Make News Navbar item default for unauthed users on mobile
* Add Dash Navbar item for authed users on mobile
This commit is contained in:
Sebastian Grewe 2013-06-29 15:26:16 +02:00
parent dc2dda63f5
commit f9f776a015
2 changed files with 5 additions and 4 deletions

View File

@ -13,17 +13,17 @@ foreach ($aNews as $key => $aData) {
$aNews[$key]['content'] = Markdown::defaultTransform($aData['content']);
}
// Load news entries in case news is the homepage
// Load news entries for Desktop site and unauthenticated users
$smarty->assign("NEWS", $aNews);
// Tempalte specifics
if ($detect->isMobile()) {
if ($detect->isMobile() && $_SESSION['AUTHENTICATED'] == true) {
if ($config['payout_system'] == 'pps') {
$smarty->assign("CONTENT", "pps.tpl");
} else {
$smarty->assign("CONTENT", "default.tpl");
}
} else {
$smarty->assign("CONTENT", "default.tpl");
$smarty->assign("CONTENT", "../news/default.tpl");
}
?>

View File

@ -1,11 +1,12 @@
<div data-role="navbar">
<ul>
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
<li><a href="{$smarty.server.PHP_SELF}" data-icon="home" data-ajax="false">Dash</a></li>
<li><a href="{$smarty.server.PHP_SELF}?page=news" data-icon="info" data-ajax="false">News</a></li>
{if $smarty.session.AUTHENTICATED|default:"0" == 1}
<li><a href="{$smarty.server.PHP_SELF}?page=statistics&action=pool" data-icon="grid" data-ajax="false">Statistics</a></li>
<li><a href="{$smarty.server.PHP_SELF}?page=logout" data-icon="gear" data-ajax="false">Logout</a></li>
{else}
<li><a href="{$smarty.server.PHP_SELF}" data-icon="info" data-ajax="false">News</a></li>
<li><a href="{$smarty.server.PHP_SELF}?page=login" data-icon="gear" data-ajax="false">Login</a></li>
{/if}
</ul>