Skip to content
Snippets Groups Projects
Commit bb371da4 authored by Denis Walker's avatar Denis Walker
Browse files

Forces Smarty $news variable not to exist if there are no news items

parent a589b045
No related branches found
No related tags found
No related merge requests found
......@@ -41,7 +41,8 @@ $query = "SELECT *, date_part('epoch', expiry) AS expirytime FROM news";
if (@$pathlist[2]!="") $query .= " WHERE title=".$DB->qstr($pathlist[2]);
$query .= " ORDER BY date DESC";
$smarty->assign("news", $DB->GetArray($query));
$newsarray = $DB->GetArray($query);
if (!empty($newsarray)) $smarty->assign("news", $newsarray);
$output = $smarty->fetch("news.tpl");
$smarty->assign("title", "News");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment