aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorz0rglub <z0rglub@piwigo.org>2004-11-05 21:36:35 +0000
committerz0rglub <z0rglub@piwigo.org>2004-11-05 21:36:35 +0000
commitfb53abe3bdb0746f52934b84e1627c6ff99c5339 (patch)
tree744de2591c0b7e171d48af0d9668fbb3db3b3355 /include
parentd2884e69ce33718e83f7da93adae0ba8a86d68cc (diff)
- 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
Diffstat (limited to 'include')
-rw-r--r--include/config.inc.php10
-rw-r--r--include/constants.php4
-rw-r--r--include/functions.inc.php4
-rw-r--r--include/functions_user.inc.php4
-rw-r--r--include/page_tail.php3
5 files changed, 16 insertions, 9 deletions
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());
}