diff --git a/install/includes/config.php b/install/includes/config.php index ccb38f72..380fff7d 100644 --- a/install/includes/config.php +++ b/install/includes/config.php @@ -26,7 +26,7 @@ if(!isset($error) || !$error) { $config['database_type'] = $config['lua']['database_type']; else if(isset($config['lua']['sql_type'])) // otserv $config['database_type'] = $config['lua']['sql_type']; - + $config['database_type'] = strtolower($config['database_type']); if(empty($config['database_type'])) { error($locale['step_database_error_database_empty']); diff --git a/system/template.php b/system/template.php index 14ae3b4f..8b349f3c 100644 --- a/system/template.php +++ b/system/template.php @@ -54,26 +54,30 @@ else { if(file_exists(BASE . $template_path . '/config.php')) { require BASE . $template_path . '/config.php'; } + +$tmp = ''; +if ($cache->enabled() && $cache->fetch('template_ini_' . $template_name, $tmp)) { + $template_ini = unserialize($tmp); +} else { $file = BASE . $template_path . '/config.ini'; $exists = file_exists($file); if ($exists || ($config['backward_support'] && file_exists(BASE . $template_path . '/layout_config.ini'))) { - if (!$exists) + if (!$exists) { $file = BASE . $template_path . '/layout_config.ini'; + } + + $template_ini = parse_ini_file($file); if ($cache->enabled()) { - $tmp = ''; - if ($cache->fetch('template_ini_' . $template_name, $tmp)) - $template_ini = unserialize($tmp); - else { - $template_ini = parse_ini_file($file); - $cache->set('template_ini_' . $template_name, serialize($template_ini)); - } - } else - $template_ini = parse_ini_file($file); + $cache->set('template_ini_' . $template_name, serialize($template_ini)); + } + } +} - foreach ($template_ini as $key => $value) - $config[$key] = $value; +if (isset($template_ini)) { + foreach ($template_ini as $key => $value) { + $config[$key] = $value; } } @@ -134,9 +138,16 @@ function get_template_menus() { } $new_menus = array(); - foreach(config('menu_categories') as $id => $options) { - if(isset($menus[$id])) + /** + * @var array $configMenuCategories + * @var int $id + * @var array $options + */ + $configMenuCategories = config('menu_categories'); + foreach($configMenuCategories as $id => $options) { + if(isset($menus[$id])) { $new_menus[$id] = $menus[$id]; + } } return $new_menus; diff --git a/templates/kathrine/config.ini b/templates/kathrine/config.ini new file mode 100644 index 00000000..e6f2ea67 --- /dev/null +++ b/templates/kathrine/config.ini @@ -0,0 +1,3 @@ +darkborder = "#d0cdb4" +lightborder = "#e5e3d7" +vdarkborder = "#afab89" \ No newline at end of file diff --git a/templates/kathrine/config.php b/templates/kathrine/config.php index 93e037e1..a53500b1 100644 --- a/templates/kathrine/config.php +++ b/templates/kathrine/config.php @@ -1,13 +1,8 @@ array('id' => 'news', 'name' => 'Latest News'), MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'), MENU_CATEGORY_COMMUNITY => array('id' => 'community', 'name' => 'Community'), MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'), MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop') -); - -?> +); \ No newline at end of file diff --git a/templates/tibiacom/config.ini b/templates/tibiacom/config.ini new file mode 100644 index 00000000..1a606da1 --- /dev/null +++ b/templates/tibiacom/config.ini @@ -0,0 +1,18 @@ +darkborder = "#D4C0A1" +lightborder = "#F1E0C6" +vdarkborder = "#505050" + +logo_monster = "Wyrm" + +; List: newcomer,gallery,premium,poll,highscores,networks +boxes = "highscores,newcomer,gallery,networks,poll" + +; leave empty to disable +network_facebook = "tibia" + +; leave empty to disable +network_twitter = "tibia" + +background_image = "background-artwork.jpg" +logo_image = "tibia-logo-artwork-top.gif" +gallery_image_id_from_database = 1 \ No newline at end of file diff --git a/templates/tibiacom/config.php b/templates/tibiacom/config.php index 945fa94b..5e529e06 100644 --- a/templates/tibiacom/config.php +++ b/templates/tibiacom/config.php @@ -1,18 +1,4 @@ array('id' => 'news', 'name' => 'Latest News'), MENU_CATEGORY_ACCOUNT => array('id' => 'account', 'name' => 'Account'), @@ -21,4 +7,3 @@ $config['menu_categories'] = array( MENU_CATEGORY_LIBRARY => array('id' => 'library', 'name' => 'Library'), MENU_CATEGORY_SHOP => array('id' => 'shops', 'name' => 'Shop') ); -?>