* moved template menus to database, they're now dynamically loaded

* you can edit them in Admin Panel under 'Menus' option.
* you can also add custom links, like http://google.pl
* removed videos pages, as it can be easily added using custom Menus and Pages with insert Media
* removed bug_report configurable, its now enabled by default
This commit is contained in:
slawkens
2017-10-24 14:42:23 +02:00
parent 195ec4b11e
commit 6c9e09ea73
22 changed files with 497 additions and 604 deletions

View File

@@ -81,7 +81,7 @@ $template['link_account_logout'] = getLink('account/logout');
$template['link_news_archive'] = getLink('news/archive');
$links = array('news', 'changelog', 'rules', 'downloads', 'characters', 'online', 'highscores', 'powergamers', 'lastkills', 'houses', 'guilds', 'wars', 'polls', 'bans', 'team', 'creatures', 'spells', 'commands', 'experienceStages', 'freeHouses', 'serverInfo', 'experienceTable', 'faq', 'points', 'gifts', 'bugtracker');
$links = array('news', 'changelog', 'rules', 'downloads', 'characters', 'online', 'highscores', 'powergamers', 'lastkills', 'houses', 'guilds', 'wars', 'polls', 'bans', 'team', 'creatures', 'spells', 'commands', 'experienceStages', 'freeHouses', 'serverInfo', 'experienceTable', 'faq', 'points', 'gifts', 'bugtracker', 'gallery');
foreach($links as $link) {
$template['link_' . $link] = getLink($link);
}
@@ -101,4 +101,16 @@ if($config['forum'] != '')
$twig->addGlobal('template_path', $template_path);
if($twig_loader && file_exists(BASE . $template_path))
$twig_loader->prependPath(BASE . $template_path);
function get_template_menus() {
global $db, $template_name;
$menus = array();
$query = $db->query('SELECT `name`, `link`, `category` FROM `' . TABLE_PREFIX . 'menu` WHERE `template` = ' . $db->quote($template_name) . ' ORDER BY `ordering` ASC');
foreach($query->fetchAll() as $menu) {
$menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link']);
}
return $menus;
}
?>