php-mpos/public/include/pages/home.inc.php
Sebastian Grewe c66c448836 Adding mobile dashboard and news page
* Adding mobile detection to home page
* Allow home page to default to news for desktops
* Use payout specific sidebar for mobile homescreen
* Added News navigation option to mobile

Fixes #278
Fixes #279
2013-06-29 15:11:57 +02:00

30 lines
711 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 in case news is the homepage
$smarty->assign("NEWS", $aNews);
// Tempalte specifics
if ($detect->isMobile()) {
if ($config['payout_system'] == 'pps') {
$smarty->assign("CONTENT", "pps.tpl");
} else {
$smarty->assign("CONTENT", "default.tpl");
}
} else {
$smarty->assign("CONTENT", "default.tpl");
}
?>