Fix another notice

feature/node-rewrite
Sven Slootweg 12 years ago
parent b702923505
commit 236f5d2c4d

@ -172,18 +172,23 @@ foreach($result->data as $row)
); );
} }
$result = $database->CachedQuery("SELECT * FROM templates WHERE `Available` = 1");
$sTemplates = array(); $sTemplates = array();
foreach($result->data as $row) if($result = $database->CachedQuery("SELECT * FROM templates WHERE `Available` = 1"))
{ {
foreach($result->data as $row)
{
$sTemplate = new Template($row); $sTemplate = new Template($row);
$sTemplates[] = array( $sTemplates[] = array(
'id' => $sTemplate->sId, 'id' => $sTemplate->sId,
'name' => $sTemplate->sName 'name' => $sTemplate->sName
); );
}
}
else
{
/* TODO: Show an error when no templates are available. */
} }
$result = $database->CachedQuery("SELECT * FROM users WHERE `AccessLevel` > 0"); $result = $database->CachedQuery("SELECT * FROM users WHERE `AccessLevel` > 0");

Loading…
Cancel
Save