From 61f7b4cc39a399a16298453acbe5a8f49ad0513d Mon Sep 17 00:00:00 2001 From: neoraider Date: Sat, 7 Jan 2006 01:30:00 +0000 Subject: Hmm... die Content-Handler sind jetzt ansatzweise implementiert. --- code/content.inc.php | 17 +++++++++++++++++ code/db.inc.php | 8 +++++++- code/message.inc.php | 4 ++-- code/subst.inc.php | 17 ----------------- code/util.inc.php | 14 ++++++++++++++ 5 files changed, 40 insertions(+), 20 deletions(-) create mode 100644 code/content.inc.php delete mode 100644 code/subst.inc.php create mode 100644 code/util.inc.php (limited to 'code') diff --git a/code/content.inc.php b/code/content.inc.php new file mode 100644 index 0000000..5fc2d76 --- /dev/null +++ b/code/content.inc.php @@ -0,0 +1,17 @@ +fields[2], $data); + + include('handlers/' . $res->fields[1]); + + return $handlers[$res->fields[1]]($data); + } + } +?> diff --git a/code/db.inc.php b/code/db.inc.php index 0c30e86..2f83f58 100644 --- a/code/db.inc.php +++ b/code/db.inc.php @@ -2,10 +2,16 @@ if(!defined('DB_INC')) { define('DB_INC', 1); - include('adodb.inc.php'); include('config/config.inc.php'); + include('adodb.inc.php'); + $conn = ADONewConnection($config['driver']); $conn->PConnect($config['server'], $config['user'], $config['password'], $config['db']); + + function DBQuery($query, $args = null) { + $sql = $GLOBALS['conn']->Prepare($query); + return $GLOBALS['conn']->Execute($sql, $args); + } } ?> diff --git a/code/message.inc.php b/code/message.inc.php index 013c697..7f9343d 100644 --- a/code/message.inc.php +++ b/code/message.inc.php @@ -4,10 +4,10 @@ include('config/config.inc.php'); - include('code/subst.inc.php'); + include('code/util.inc.php'); $message['PageNotFound'] = 'The page $page does not exist.'; - $message['Forbidden'] = 'The page $page is protected.'; + $message['Forbidden'] = 'The page $page is protected.'; $message['InternalError'] = 'An internal error has occourred.'; if($config['language'] != 'en') @include('lang/' . $config['language'] . '.inc.php'); diff --git a/code/subst.inc.php b/code/subst.inc.php deleted file mode 100644 index 72935a2..0000000 --- a/code/subst.inc.php +++ /dev/null @@ -1,17 +0,0 @@ - diff --git a/code/util.inc.php b/code/util.inc.php new file mode 100644 index 0000000..275d3c7 --- /dev/null +++ b/code/util.inc.php @@ -0,0 +1,14 @@ + $value) + $tr['$' . $key] = $value; + + return strtr($string, $tr); + } + } +?> -- cgit v1.2.3