From fb53abe3bdb0746f52934b84e1627c6ff99c5339 Mon Sep 17 00:00:00 2001 From: z0rglub Date: Fri, 5 Nov 2004 21:36:35 +0000 Subject: - DEFAULT_LANGUAGE constant moved to $conf['default_language'] - DEBUG constant divided into $conf['show_queries'] and $conf['show_gt'] (display generation time at the bottom of each page) git-svn-id: http://piwigo.org/svn/trunk@592 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/config.inc.php | 10 ++++++++++ include/constants.php | 4 ---- include/functions.inc.php | 4 +++- include/functions_user.inc.php | 4 ++-- include/page_tail.php | 3 +-- 5 files changed, 16 insertions(+), 9 deletions(-) (limited to 'include') diff --git a/include/config.inc.php b/include/config.inc.php index e1a9acfa2..bf6d9a5fa 100644 --- a/include/config.inc.php +++ b/include/config.inc.php @@ -146,4 +146,14 @@ $conf['session_id_size'] = 10; // info_nb_elements_page : number of elements to display per page on // admin/infos_images $conf['info_nb_elements_page'] = 5; + +// default_language : language used if language set in user database is not +// available +$conf['default_language'] = 'en_UK.iso-8859-1'; + +// show_queries : for debug purpose, show queries and execution times +$conf['show_queries'] = false; + +// show_gt : display generation time at the bottom of each page +$conf['show_gt'] = true; ?> diff --git a/include/constants.php b/include/constants.php index c44a5cc65..9a8fa1d29 100644 --- a/include/constants.php +++ b/include/constants.php @@ -26,14 +26,10 @@ // +-----------------------------------------------------------------------+ // Default settings -define('DEFAULT_LANGUAGE', 'en_UK.iso-8859-1'); define('PHPWG_VERSION', 'BSF'); define('PHPWG_URL', 'http://www.phpwebgallery.net'); define('PHPWG_FORUM_URL', 'http://forum.phpwebgallery.net'); -// Debug Level : 1 = on, 0 = off -define('DEBUG', 0); - // User level define('ANONYMOUS', 2); diff --git a/include/functions.inc.php b/include/functions.inc.php index af2c6d6b3..99fb01cbb 100644 --- a/include/functions.inc.php +++ b/include/functions.inc.php @@ -446,10 +446,12 @@ function pwg_write_debug() function pwg_query($query) { + global $conf; + $start = get_moment(); $result = mysql_query($query); - if (DEBUG) + if ($conf['show_queries']) { global $count_queries,$queries_time; diff --git a/include/functions_user.inc.php b/include/functions_user.inc.php index 0d4a5f1a6..f78e10207 100644 --- a/include/functions_user.inc.php +++ b/include/functions_user.inc.php @@ -226,7 +226,7 @@ function init_userprefs($userdata) if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php')) ) { - $language = DEFAULT_LANGUAGE; + $language = $conf['default_language']; } include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/common.lang.php'); @@ -235,7 +235,7 @@ function init_userprefs($userdata) { if ( !file_exists(@realpath(PHPWG_ROOT_PATH . 'language/' . $language. '/admin.lang.php')) ) { - $language = DEFAULT_LANGUAGE; + $language = $conf['default_language']; } include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/admin.lang.php'); include_once(PHPWG_ROOT_PATH . 'language/' . $language . '/faq.lang.php'); diff --git a/include/page_tail.php b/include/page_tail.php index c8193d813..c3dbd1cae 100644 --- a/include/page_tail.php +++ b/include/page_tail.php @@ -43,8 +43,7 @@ $template->assign_vars( )); -//if (DEBUG) -if (true) +if ($conf['show_gt']) { $template->assign_block_vars('debug', array()); } -- cgit v1.2.3