function site_routing($routes) { global $smarty; $smarty->assign('currentRoute', $routes[1]); if ('home' == $routes[1] || '' == $routes[1]) { home_action(); } elseif ($routes[1] == 'creations') { creations_action(); } elseif ($routes[1] == 'contact') { contact_action(); } else { header('Status: 404 Not Found'); error404_action(); } }
$language = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); if ($language == "fr") { $language = "fr_FR"; } else { $language = "en_US"; } } putenv("LANG={$language}"); setlocale(LC_ALL, $language); $domain = 'messages'; bindtextdomain($domain, "./templates/locale"); textdomain($domain); // route the request internally $uri = $_SERVER['REQUEST_URI']; if ('/' == $uri) { home_action(); } elseif ('/login' == $uri) { login_action(); } elseif ('/logout' == $uri) { logout_action(); } elseif ('/signup' == $uri) { signup_action(); } elseif ('/account' == $uri && isset($_SESSION['uid'])) { account_action($_SESSION['uid']); } elseif ('/useradded' == $uri && isset($_SESSION['uid'])) { list_users_action($_SESSION['uid']); } elseif ('/users' == substr($uri, 0, 6) && isset($_SESSION['uid'])) { list_users_action($_SESSION['uid']); } elseif ('/user/delete' == substr($uri, 0, 12) && isset($_GET['uid'])) { delete_user_action($_SESSION['uid'], $_GET['uid']); } elseif ('/user' == substr($uri, 0, 5) && isset($_GET['uid'])) {