Twig updates

Moved non-global functions from twig back into PHP.
This commit is contained in:
Lee
2021-01-04 13:11:18 +00:00
parent 8c06bd1738
commit 5547ccffd6
3 changed files with 14 additions and 19 deletions

View File

@@ -13,10 +13,19 @@ defined('MYAAC') or die('Direct access not allowed!');
$title = "Creatures";
if (empty($_REQUEST['creature'])) {
$creatures = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 '.(empty($_REQUEST['boss']) ? '': 'AND `rewardboss` = 1').' ORDER BY name asc');
$preview = config('creature_images_preview');
$creatures = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 '.(empty($_REQUEST['boss']) ? '': 'AND `rewardboss` = 1').' ORDER BY name asc')->fetchAll();
if ($preview) {
foreach($creatures as $key => &$creature)
{
$creature['img_link'] = getCreatureImgPath($creature['name']);
}
}
$twig->display('creatures.html.twig', array(
'creatures' => $creatures->fetchAll(),
'preview' => config('creature_images_preview'),
'creatures' => $creatures,
'preview' => $preview
));
} else {