php-mpos/public/include/pages/home.inc.php
Sebastian Grewe f9f776a015 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
2013-06-29 15:26:16 +02:00

30 lines
771 B
PHP

<?php
// Make sure we are called from index.php
if (!defined('SECURITY')) die('Hacking attempt');
// Include markdown library
use \Michelf\Markdown;
// Fetch active news to display
$aNews = $news->getAllActive();
foreach ($aNews as $key => $aData) {
// Transform Markdown content to HTML
$aNews[$key]['content'] = Markdown::defaultTransform($aData['content']);
}
// Load news entries for Desktop site and unauthenticated users
$smarty->assign("NEWS", $aNews);
// Tempalte specifics
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", "../news/default.tpl");
}
?>