Merge pull request #233 from TheSerapher/issue-232

Issue 232
This commit is contained in:
Sebastian Grewe 2013-06-21 11:26:42 -07:00
commit ac74c00540
5 changed files with 17 additions and 30 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

@ -15,7 +15,6 @@
<ul>
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=user">User Info</a></li>
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=wallet">Wallet Info</a></li>
<li><a href="{$smarty.server.PHP_SELF}?page=admin&action=news">News Posts</a></li>
</ul>
</li>
{/if}

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}