From 60599b407610796c65bbbafc88a8fe5b29f37c7a Mon Sep 17 00:00:00 2001 From: neoraider Date: Sat, 16 Dec 2006 21:35:01 +0000 Subject: Subst() optimiert. --- index.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'index.php') diff --git a/index.php b/index.php index e933274..db5847c 100644 --- a/index.php +++ b/index.php @@ -11,19 +11,25 @@ if($_GET['page']) $page = Unquote($_GET['page']); else $page = $GLOBALS['config']['home']; - $res = $GLOBALS['db']->Execute('SELECT code FROM base ORDER BY id'); + $res = $GLOBALS['db']->Execute('SELECT id, code FROM base ORDER BY id'); - $base = ''; + $env = array('current_page' => $page); + if($_GET['mode'] == 'edit') $env['current_page'] = '$editor:' . $page; + + $content = ''; + $body = false; while(!$res->EOF) { - $base .= $res->fields[0]; + if($body == false && $res->fields[0] > 0) { + $body = true; + $content .= ''; + } + $content .= Subst($res->fields[1], $env); $res->MoveNext(); } $env = array('current_page' => $page); if($_GET['mode'] == 'edit') $env['current_page'] = '$editor:' . $page; - $content = Subst($base, $env); - echo ''; ?> -- cgit v1.2.3