diff options
Diffstat (limited to 'code')
-rw-r--r-- | code/config.inc.php | 11 | ||||
-rw-r--r-- | code/db.inc.php | 6 | ||||
-rw-r--r-- | code/message.inc.php | 3 |
3 files changed, 15 insertions, 5 deletions
diff --git a/code/config.inc.php b/code/config.inc.php new file mode 100644 index 0000000..b94a74e --- /dev/null +++ b/code/config.inc.php @@ -0,0 +1,11 @@ +<?PHP + require_once('config/config.inc.php'); + + require_once('code/db.inc.php'); + + + $res = $GLOBALS['db']->Execute('SELECT name, value FROM config WHERE module = 0'); + + while($row = $res->FetchRow()) + $GLOBALS['config'][$row[0]] = $row[1]; +?> diff --git a/code/db.inc.php b/code/db.inc.php index 72f9025..706f63d 100644 --- a/code/db.inc.php +++ b/code/db.inc.php @@ -4,7 +4,7 @@ require_once('adodb/adodb.inc.php'); - $GLOBALS['db'] = &ADONewConnection($config['driver']); - $GLOBALS['db']->PConnect($config['server'], $config['user'], - $config['password'], $config['db']); + $GLOBALS['db'] = &ADONewConnection($GLOBALS['config']['driver']); + $GLOBALS['db']->PConnect($GLOBALS['config']['server'], $GLOBALS['config']['user'], + $GLOBALS['config']['password'], $GLOBALS['config']['db']); ?> diff --git a/code/message.inc.php b/code/message.inc.php index f64905f..092f4ec 100644 --- a/code/message.inc.php +++ b/code/message.inc.php @@ -1,6 +1,5 @@ <?PHP - require_once('config/config.inc.php'); - + require_once('code/config.inc.php'); require_once('code/util.inc.php'); $message['Error'] = 'Error'; |