diff options
author | Arno Richter <oelna@oelna.de> | 2022-12-13 22:27:21 +0100 |
---|---|---|
committer | Arno Richter <oelna@oelna.de> | 2022-12-13 22:27:44 +0100 |
commit | 0b075f3ea2616cfde4d976199a69ba631174a336 (patch) | |
tree | bb1feef58d9c714f6c3fb0b75f1e52b0181cf2af /index.php | |
parent | f0e3ff408db8ee40611f75cdf96892f90034bd60 (diff) | |
download | microblog-0b075f3ea2616cfde4d976199a69ba631174a336.tar.gz microblog-0b075f3ea2616cfde4d976199a69ba631174a336.tar.bz2 microblog-0b075f3ea2616cfde4d976199a69ba631174a336.zip |
gave up and sorted files into a directory structure. made snippets for header, nav and footer. made it easier to add additional css files as themes. prepare a little for addition of a real template engine. added a css reset file to share between themes, if warranted.
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -2,16 +2,18 @@ require_once(__DIR__.DIRECTORY_SEPARATOR.'config.php'); // check user credentials - $config['logged_in'] = false; $config['logged_in'] = check_login(); // subpages + $template = 'timeline'; if(is_numeric(path(0))) { // show a single blog post - require_once(ROOT.DS.'single.inc.php'); + $template = 'single'; + require_once(ROOT.DS.'templates'.DS.'single.inc.php'); } elseif(mb_strtolower(path(0)) === 'login') { - require_once(ROOT.DS.'loginform.inc.php'); + $template = 'login'; + require_once(ROOT.DS.'templates'.DS.'loginform.inc.php'); } elseif(mb_strtolower(path(0)) === 'logout') { $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false; @@ -22,7 +24,8 @@ die(); } elseif(mb_strtolower(path(0)) === 'new') { - require_once(ROOT.DS.'postform.inc.php'); + $template = 'postform'; + require_once(ROOT.DS.'templates'.DS.'postform.inc.php'); } else { // redirect everything else to the homepage @@ -32,5 +35,5 @@ } // show the homepage - require_once(ROOT.DS.'timeline.inc.php'); + require_once(ROOT.DS.'templates'.DS.'timeline.inc.php'); } |