Trying to turn this
into this:
I think it has to do with this
into this:
I think it has to do with this
PHP:
final public function getPageNews()
{
global $template, $engine;
if(!isset($_GET['id']) || !is_numeric($_GET['id']))
{
$_GET['id'] = 1;
}
$result = mysql_query("SELECT title, id FROM cms_news WHERE id != '" . $engine->secure($_GET['id']) . "' ORDER BY id DESC");
while($news1 = mysql_fetch_array($result))
{
$template->setParams('newsList', '« <a href="/news/'.$news1["id"].'">' . $news1['title'] . '</a><br/>');
}
$news = $engine->fetch_assoc("SELECT title, shortstory, longstory, author, published FROM cms_news WHERE id = '" . $engine->secure($_GET['id']) . "' LIMIT 1");
$template->setParams('newsTitle', $news['title']);
$template->setParams('newsContent', $news['longstory']);
$template->setParams('newsAuthor', $news['author']);
$template->setParams('newsDate', date("d-m-y", $news['published']));
$template->setParams('newsPreview', $news['shortstory']);
unset($result);
unset($news1);
unset($news);
}