diff options
author | Loui Chang <louipc.ist@gmail.com> | 2009-03-03 18:55:14 +0100 |
---|---|---|
committer | Loui Chang <louipc.ist@gmail.com> | 2009-03-03 18:55:14 +0100 |
commit | 3c1b84bc7ec119c6cf2a9ad62f0a92c62d16c6d5 (patch) | |
tree | 7638eb904bb233dc1a0346371f8aab4abfc0b673 /web/lib | |
parent | 5e5c95c6a88344a07c2a74a90cb85213da8f697f (diff) | |
download | aur-3c1b84bc7ec119c6cf2a9ad62f0a92c62d16c6d5.tar.gz aur-3c1b84bc7ec119c6cf2a9ad62f0a92c62d16c6d5.tar.xz |
Go to details page when a search returns one result.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Diffstat (limited to 'web/lib')
-rw-r--r-- | web/lib/pkgfuncs.inc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 05705d0b..24b4739b 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -408,8 +408,6 @@ function pkg_search_page($SID="") { $_GET["PP"] = 25; } - include('../template/pkg_search_form.php'); - // FIXME: pull out DB-related code. all of it. // this one's worth a choco-chip cookie, // one of those nice big soft ones @@ -529,7 +527,15 @@ function pkg_search_page($SID="") { $last = $_GET['PP'] + $_GET['O']; } - include('pkg_search_results.php'); + + if ($total > 1) { + include('pkg_search_form.php'); + include('pkg_search_results.php'); + } + else { + $pkgdetails = mysql_fetch_assoc($result); + header("Location: packages.php?ID={$pkgdetails['ID']}"); + } return; } |