diff options
author | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-07-14 01:57:19 +0200 |
---|---|---|
committer | Lukas Fleischer <archlinux@cryptocrack.de> | 2012-07-15 22:48:32 +0200 |
commit | 03486c3b6feafb18f00b0e0c092a1bd4ac2f3903 (patch) | |
tree | f91bbdf64c725e35c7f08ac930e7fcd2a1f066c6 /web/html/index.php | |
parent | 2425f963f8ad45292c217914b5fee1ed18104c26 (diff) | |
download | aurweb-03486c3b6feafb18f00b0e0c092a1bd4ac2f3903.tar.xz |
Use virtual paths for package details
Extend the routing front/back ends to allow for using
"/package/$pkgname/" for individual packages.
Signed-off-by: Lukas Fleischer <archlinux@cryptocrack.de>
Diffstat (limited to 'web/html/index.php')
-rw-r--r-- | web/html/index.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/web/html/index.php b/web/html/index.php index b0f346d..de38178 100644 --- a/web/html/index.php +++ b/web/html/index.php @@ -5,8 +5,16 @@ include_once("config.inc.php"); include_once("routing.inc.php"); $path = rtrim($_SERVER['PATH_INFO'], '/'); +$tokens = explode('/', $path); -if (get_route($path) !== NULL) { +if (isset($tokens[1]) &&'/' . $tokens[1] == get_pkg_route()) { + if (isset($tokens[2])) { + unset($_GET['ID']); + $_GET['N'] = $tokens[2]; + } + + include get_route('/' . $tokens[1]); +} elseif (get_route($path) !== NULL) { include get_route($path); } else { switch ($path) { |