php-mpos/public/include/pages/news.inc.php
2013-07-04 08:51:13 +02:00

22 lines
506 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();
if (is_array($aNews)) {
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");
?>