From c66c448836526e0bf49b37a9e775226367c7cec1 Mon Sep 17 00:00:00 2001 From: Sebastian Grewe Date: Sat, 29 Jun 2013 15:11:57 +0200 Subject: [PATCH] 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 --- public/include/pages/home.inc.php | 14 ++++- public/include/pages/news.inc.php | 19 ++++++ public/templates/mmcFE/news/default.tpl | 5 ++ public/templates/mobile/global/navigation.tpl | 3 +- public/templates/mobile/home/default.tpl | 59 ++++++++++++++++--- public/templates/mobile/home/pps.tpl | 50 ++++++++++++++++ public/templates/mobile/news/default.tpl | 8 +++ 7 files changed, 147 insertions(+), 11 deletions(-) create mode 100644 public/include/pages/news.inc.php create mode 100644 public/templates/mmcFE/news/default.tpl create mode 100644 public/templates/mobile/home/pps.tpl create mode 100644 public/templates/mobile/news/default.tpl diff --git a/public/include/pages/home.inc.php b/public/include/pages/home.inc.php index 38e1022d..ffd08520 100644 --- a/public/include/pages/home.inc.php +++ b/public/include/pages/home.inc.php @@ -13,7 +13,17 @@ foreach ($aNews as $key => $aData) { $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); } -// Tempalte specifics +// Load news entries in case news is the homepage $smarty->assign("NEWS", $aNews); -$smarty->assign("CONTENT", "default.tpl"); + +// 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"); +} ?> diff --git a/public/include/pages/news.inc.php b/public/include/pages/news.inc.php new file mode 100644 index 00000000..38e1022d --- /dev/null +++ b/public/include/pages/news.inc.php @@ -0,0 +1,19 @@ +getAllActive(); +foreach ($aNews as $key => $aData) { + // Transform Markdown content to HTML + $aNews[$key]['content'] = Markdown::defaultTransform($aData['content']); +} + +// Tempalte specifics +$smarty->assign("NEWS", $aNews); +$smarty->assign("CONTENT", "default.tpl"); +?> diff --git a/public/templates/mmcFE/news/default.tpl b/public/templates/mmcFE/news/default.tpl new file mode 100644 index 00000000..e898af86 --- /dev/null +++ b/public/templates/mmcFE/news/default.tpl @@ -0,0 +1,5 @@ +{section name=news loop=$NEWS} + {include file="global/block_header.tpl" BLOCK_HEADER="{$NEWS[news].header}, posted {$NEWS[news].time|date_format:"%b %e, %Y at %H:%M"} by {$NEWS[news].author}"} + {$NEWS[news].content} + {include file="global/block_footer.tpl"} +{/section} diff --git a/public/templates/mobile/global/navigation.tpl b/public/templates/mobile/global/navigation.tpl index 2821454f..92785791 100644 --- a/public/templates/mobile/global/navigation.tpl +++ b/public/templates/mobile/global/navigation.tpl @@ -1,6 +1,7 @@