3 include_once("confparser.inc.php");
7 '/index.php' => 'home.php',
8 '/packages' => 'packages.php',
9 '/pkgbase' => 'pkgbase.php',
10 '/requests' => 'pkgreq.php',
11 '/register' => 'register.php',
12 '/account' => 'account.php',
13 '/accounts' => 'account.php',
14 '/login' => 'login.php',
15 '/logout' => 'logout.php',
16 '/passreset' => 'passreset.php',
20 '/addvote' => 'addvote.php',
23 $PKG_PATH = '/packages';
24 $PKGBASE_PATH = '/pkgbase';
25 $PKGREQ_PATH = '/requests';
26 $USER_PATH = '/account';
28 function get_route($path) {
31 $path = rtrim($path, '/');
32 if (isset($ROUTES[$path])) {
33 return $ROUTES[$path];
39 function get_uri($path, $absolute=false) {
41 return rtrim(aur_location(), '/') . $path;
47 function get_pkg_route() {
52 function get_pkgbase_route() {
57 function get_pkgreq_route() {
62 function get_pkg_uri($pkgname, $absolute=false) {
64 $path = $PKG_PATH . '/' . urlencode($pkgname) . '/';
65 return get_uri($path, $absolute);
68 function get_pkgbase_uri($pkgbase_name, $absolute=false) {
70 $path = $PKGBASE_PATH . '/' . urlencode($pkgbase_name) . '/';
71 return get_uri($path, $absolute);
74 function get_user_route() {
79 function get_user_uri($username, $absolute=false) {
81 $path = $USER_PATH . '/' . urlencode($username) . '/';
82 return get_uri($path, $absolute);