diff options
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'); } |