mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 17:29:21 +02:00
* menus are now showed by the order they're saved into menu_categories configurable
* fixed visitors in admin panel showing, when cache is disabled
This commit is contained in:
parent
56a0c6e6bf
commit
39fee6e57d
@ -107,7 +107,7 @@ class Visitors
|
||||
}
|
||||
|
||||
global $db;
|
||||
return $db->query('SELECT ' . $db->fieldName('ip') . ', ' . $db->fieldName('lastvisit') . ', ' . $db->fieldName('page') . ' FROM ' . $db->tableName(TABLE_PREFIX . 'visitors') . ' ORDER BY ' . $db->fieldName('lastvisit') . ' DESC')->fetch();
|
||||
return $db->query('SELECT ' . $db->fieldName('ip') . ', ' . $db->fieldName('lastvisit') . ', ' . $db->fieldName('page') . ' FROM ' . $db->tableName(TABLE_PREFIX . 'visitors') . ' ORDER BY ' . $db->fieldName('lastvisit') . ' DESC')->fetchAll();
|
||||
}
|
||||
|
||||
public function getAmountVisitors()
|
||||
|
@ -103,7 +103,7 @@ if($twig_loader && file_exists(BASE . $template_path))
|
||||
$twig_loader->prependPath(BASE . $template_path);
|
||||
|
||||
function get_template_menus() {
|
||||
global $db, $template_name;
|
||||
global $db, $config, $template_name;
|
||||
|
||||
$menus = array();
|
||||
$query = $db->query('SELECT `name`, `link`, `category` FROM `' . TABLE_PREFIX . 'menu` WHERE `template` = ' . $db->quote($template_name) . ' ORDER BY `category`, `ordering` ASC');
|
||||
@ -111,6 +111,12 @@ function get_template_menus() {
|
||||
$menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link']);
|
||||
}
|
||||
|
||||
return $menus;
|
||||
$new_menus = array();
|
||||
foreach($config['menu_categories'] as $id => $options) {
|
||||
if(isset($menus[$id]))
|
||||
$new_menus[$id] = $menus[$id];
|
||||
}
|
||||
|
||||
return $new_menus;
|
||||
}
|
||||
?>
|
||||
|
Loading…
x
Reference in New Issue
Block a user