select('SELECT * FROM ?_news ORDER BY time DESC, id DESC LIMIT 5'); foreach ($rows as $i => $row) $rows[$i]['text'] = Util::localizedString($row, 'text'); $smarty->assign('news', isset($rows) ? $rows : NULL); $smarty->assign('lang', Lang::$main); // load the page $smarty->display('main.tpl'); ?>