aboutsummaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorArno Richter <oelna@oelna.de>2022-12-13 22:27:21 +0100
committerArno Richter <oelna@oelna.de>2022-12-13 22:27:44 +0100
commit0b075f3ea2616cfde4d976199a69ba631174a336 (patch)
treebb1feef58d9c714f6c3fb0b75f1e52b0181cf2af /index.php
parentf0e3ff408db8ee40611f75cdf96892f90034bd60 (diff)
downloadmicroblog-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.php13
1 files changed, 8 insertions, 5 deletions
diff --git a/index.php b/index.php
index c0259c2..f435366 100644
--- a/index.php
+++ b/index.php
@@ -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');
}