diff --git a/TODO b/TODO index 2b42be2e..6598d513 100644 --- a/TODO +++ b/TODO @@ -2,30 +2,27 @@ 0.* * support duplicated vocation names with different ids - * cache Menus in templates * sandbox for plugins, don't install when requirements are not passed * load items & weapons on install, preferably with ajax * add changelog management interface * option to require php extension to be installed - * save detected country in session - * tibiacom template - show status on top 5 * kathrine tickets - show/hide * highscores - by balance * admin panel Menus: * open in external window (_blank option) * color of the link * should the link blink? - * cache hooks - * cache fieldExist and tableExist functions + * cache: + * hooks + * fieldExist and tableExist functions + * Menus in templates * forum: * show position of the player * replace forum actions links for admin (move, remove) with images * redirect directly to the thread on user login * latest news: - * warning about leaving page with changes * news preview option * characters: edit in admin panel option - * fix bug on othire with config.account_premium_days * move highscores to twig 1.0: diff --git a/system/init.php b/system/init.php index 8833b95a..4c6dc5f5 100644 --- a/system/init.php +++ b/system/init.php @@ -37,7 +37,8 @@ Twig_Autoloader::register(); $twig_loader = new Twig_Loader_Filesystem(SYSTEM . 'templates'); $twig = new Twig_Environment($twig_loader, array( 'cache' => CACHE . 'twig/', - 'auto_reload' => true + 'auto_reload' => true, + //'debug' => true )); $function = new Twig_SimpleFunction('getStyle', function ($i) { diff --git a/system/pages/news.php b/system/pages/news.php index 66dddaf2..dd249852 100644 --- a/system/pages/news.php +++ b/system/pages/news.php @@ -387,7 +387,7 @@ class News if(!self::verify($title, $body, $article_text, $article_image, $errors)) return false; - $db->insert(TABLE_PREFIX . 'news', array('title' => $title, 'body' => $body, 'type' => $type, 'date' => time(), 'category' => $category, 'player_id' => isset($player_id) ? $player_id : 0, 'comments' => $comments, 'article_text' => $article_text, 'article_image' => $article_image)); + $db->insert(TABLE_PREFIX . 'news', array('title' => $title, 'body' => $body, 'type' => $type, 'date' => time(), 'category' => $category, 'player_id' => isset($player_id) ? $player_id : 0, 'comments' => $comments, 'article_text' => ($type == 3 ? $article_text : ''), 'article_image' => ($type == 3 ? $article_image : ''))); return true; } diff --git a/system/template.php b/system/template.php index 4bebd4ac..55b7de0d 100644 --- a/system/template.php +++ b/system/template.php @@ -33,20 +33,20 @@ if($config['template_allow_change']) } $template_path = 'templates/' . $template_name; -if(!file_exists($template_path . '/index.php') && - !file_exists($template_path . '/template.php') && - !file_exists($template_path . '/layout.php')) +if(!file_exists(BASE . $template_path . '/index.php') && + !file_exists(BASE . $template_path . '/template.php') && + !file_exists(BASE . $template_path . '/layout.php')) { $template_name = 'kathrine'; - $template_path = TEMPLATES . $template_name; + $template_path = 'templates/' . $template_name; } -$file = $template_path . '/config.ini'; +$file = BASE . $template_path . '/config.ini'; $exists = file_exists($file); -if($exists || ($config['backward_support'] && file_exists($template_path . '/layout_config.ini'))) +if($exists || ($config['backward_support'] && file_exists(BASE . $template_path . '/layout_config.ini'))) { if(!$exists) - $file = $template_path . '/layout_config.ini'; + $file = BASE . $template_path . '/layout_config.ini'; if($cache->enabled()) { @@ -65,8 +65,8 @@ if($exists || ($config['backward_support'] && file_exists($template_path . '/lay foreach($template_ini as $key => $value) $config[$key] = $value; } -else if(file_exists($template_path . '/config.php')) - require($template_path . '/config.php'); +else if(file_exists(BASE . $template_path . '/config.php')) + require(BASE . $template_path . '/config.php'); $template = array(); $template['link_account_manage'] = getLink('account/manage'); diff --git a/system/templates/news.add.html.twig b/system/templates/news.add.html.twig index c8e769e6..1074f132 100644 --- a/system/templates/news.add.html.twig +++ b/system/templates/news.add.html.twig @@ -1,7 +1,8 @@ +
{% if action != 'edit' %} Add news {% endif %} -