summaryrefslogtreecommitdiffstats
path: root/index.php
diff options
context:
space:
mode:
Diffstat (limited to 'index.php')
-rw-r--r--index.php16
1 files changed, 11 insertions, 5 deletions
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 .= '</head><body>';
+ }
+ $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 '<?xml version="1.0" encoding="UTF-8" ?>';
?>