diff options
author | neoraider <devnull@localhost> | 2006-12-16 22:35:01 +0100 |
---|---|---|
committer | neoraider <devnull@localhost> | 2006-12-16 22:35:01 +0100 |
commit | 60599b407610796c65bbbafc88a8fe5b29f37c7a (patch) | |
tree | 81ec2498f79f5ee89038cec575d954f0ca31dbbc /index.php | |
parent | 543336aef16562369c01992817f58e17144c9cad (diff) | |
download | neon-master.tar neon-master.zip |
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -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" ?>'; ?> |