Making news page the default homepage

Addresses #232
This commit is contained in:
Sebastian Grewe 2013-06-21 20:25:12 +02:00
parent 4eaa2c8d37
commit 706a3422eb
4 changed files with 17 additions and 29 deletions

View File

@ -1,9 +1,19 @@
<?php
// Make sure we are called from index.php
if (!defined('SECURITY'))
die('Hacking attempt');
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']);
}
// Tempalte specifics
$smarty->assign("NEWS", $aNews);
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -1,19 +0,0 @@
<?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']);
}
// Tempalte specifics
$smarty->assign("NEWS", $aNews);
$smarty->assign("CONTENT", "default.tpl");
?>

View File

@ -1,3 +1,5 @@
{include file="global/block_header.tpl" BLOCK_HEADER="ThePool Collective"}
<p>Please head over to our <a href="{$smarty.server.PHP_SELF}?page=about&action=pool">pool page</a> for more details.
{include file="global/block_footer.tpl"}
{section name=news loop=$NEWS}
{include file="global/block_header.tpl" BLOCK_HEADER="{$NEWS[news].header} posted {$NEWS[news].time} by {$NEWS[news].author}"}
{$NEWS[news].content}
{include file="global/block_footer.tpl"}
{/section}

View File

@ -1,5 +0,0 @@
{section name=news loop=$NEWS}
{include file="global/block_header.tpl" BLOCK_HEADER="{$NEWS[news].header} posted {$NEWS[news].time} by {$NEWS[news].author}"}
{$NEWS[news].content}
{include file="global/block_footer.tpl"}
{/section}