summaryrefslogtreecommitdiffstats
path: root/code
diff options
context:
space:
mode:
authorneoraider <devnull@localhost>2006-01-06 14:10:03 +0100
committerneoraider <devnull@localhost>2006-01-06 14:10:03 +0100
commita89ac4fda6c7cab6cace4078491c29f215213ab2 (patch)
tree9f53ea434c2ffe1cb625aec798ff13f873731e7d /code
downloadneon-a89ac4fda6c7cab6cace4078491c29f215213ab2.tar
neon-a89ac4fda6c7cab6cace4078491c29f215213ab2.zip
Diffstat (limited to 'code')
-rw-r--r--code/db.inc.php11
-rw-r--r--code/message.inc.php19
-rw-r--r--code/subst.inc.php17
3 files changed, 47 insertions, 0 deletions
diff --git a/code/db.inc.php b/code/db.inc.php
new file mode 100644
index 0000000..0c30e86
--- /dev/null
+++ b/code/db.inc.php
@@ -0,0 +1,11 @@
+<?PHP
+ if(!defined('DB_INC')) {
+ define('DB_INC', 1);
+
+ include('adodb.inc.php');
+ include('config/config.inc.php');
+
+ $conn = ADONewConnection($config['driver']);
+ $conn->PConnect($config['server'], $config['user'], $config['password'], $config['db']);
+ }
+?>
diff --git a/code/message.inc.php b/code/message.inc.php
new file mode 100644
index 0000000..013c697
--- /dev/null
+++ b/code/message.inc.php
@@ -0,0 +1,19 @@
+<?PHP
+ if(!defined('MESSAGE_INC')) {
+ define('MESSAGE_INC', 1);
+
+ include('config/config.inc.php');
+
+ include('code/subst.inc.php');
+
+ $message['PageNotFound'] = 'The page $page does not exist.';
+ $message['Forbidden'] = 'The page $page is protected.';
+ $message['InternalError'] = 'An internal error has occourred.';
+
+ if($config['language'] != 'en') @include('lang/' . $config['language'] . '.inc.php');
+
+ function Message($type, $subst = array()) {
+ return Subst($GLOBALS['message'][$type], $subst);
+ }
+ }
+?>
diff --git a/code/subst.inc.php b/code/subst.inc.php
new file mode 100644
index 0000000..72935a2
--- /dev/null
+++ b/code/subst.inc.php
@@ -0,0 +1,17 @@
+<?PHP
+ if(!defined('SUBST_INC')) {
+ define('SUBST_INC', 1);
+
+ function Subst($string, $subst = array()) {
+ $tr['$$'] = '$';
+
+ while(current($subst)) {
+ $tr['$' . key($subst)] = $subst[key($subst)];
+
+ next($subst);
+ }
+
+ return strtr($string, $tr);
+ }
+ }
+?>