diff options
author | Arno Richter <oelna@oelna.de> | 2022-12-21 15:05:28 +0100 |
---|---|---|
committer | Arno Richter <oelna@oelna.de> | 2022-12-21 15:05:28 +0100 |
commit | 482fd7adee5e9e0990bf5904ed7d754d315de649 (patch) | |
tree | 7523a6f3482b6cb024624310f21fa7eeb05e9866 /index.php | |
parent | 057cace8b32e6c3d105695b517eae262071601f4 (diff) | |
download | microblog-482fd7adee5e9e0990bf5904ed7d754d315de649.tar.gz microblog-482fd7adee5e9e0990bf5904ed7d754d315de649.tar.bz2 microblog-482fd7adee5e9e0990bf5904ed7d754d315de649.zip |
first attempt at image attachments!
Diffstat (limited to 'index.php')
-rw-r--r-- | index.php | 57 |
1 files changed, 34 insertions, 23 deletions
@@ -13,29 +13,40 @@ $template = 'single'; require_once(ROOT.DS.'templates'.DS.'single.inc.php'); - } elseif(mb_strtolower(path(0)) === 'login') { - $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; - setcookie('microblog_login', '', time()-3600, '/', $domain, false); - unset($_COOKIE['microblog_login']); - - header('Location: '.$config['url']); - die(); - - } elseif(mb_strtolower(path(0)) === 'new') { - $template = 'postform'; - require_once(ROOT.DS.'templates'.DS.'postform.inc.php'); - } else { - // redirect everything else to the homepage - if(!empty(path(0)) && path(0) != 'page') { - header('Location: '.$config['url']); - die(); + $page = mb_strtolower(path(0)); + + switch($page) { + case 'login': + $template = 'login'; + require_once(ROOT.DS.'templates'.DS.'loginform.inc.php'); + break; + case 'logout': + $domain = ($_SERVER['HTTP_HOST'] != 'localhost') ? $_SERVER['HTTP_HOST'] : false; + setcookie('microblog_login', '', time()-3600, '/', $domain, false); + unset($_COOKIE['microblog_login']); + + header('Location: '.$config['url']); + break; + case 'new': + $template = 'postform'; + require_once(ROOT.DS.'templates'.DS.'postform.inc.php'); + break; + case 'rsd': + require_once(ROOT.DS.'lib'.DS.'rsd.xml.php'); + break; + case 'xmlrpc': + require_once(ROOT.DS.'lib'.DS.'xmlrpc.php'); + break; + default: + // redirect everything else to the homepage + if(!empty(path(0)) && path(0) != 'page') { + header('Location: '.$config['url']); + die(); + } + + // show the homepage + require_once(ROOT.DS.'templates'.DS.'timeline.inc.php'); + break; } - - // show the homepage - require_once(ROOT.DS.'templates'.DS.'timeline.inc.php'); } |