summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoui Chang <louipc.ist@gmail.com>2009-03-03 12:55:14 -0500
committerLoui Chang <louipc.ist@gmail.com>2009-03-03 12:55:14 -0500
commit3c1b84bc7ec119c6cf2a9ad62f0a92c62d16c6d5 (patch)
tree7638eb904bb233dc1a0346371f8aab4abfc0b673
parent5e5c95c6a88344a07c2a74a90cb85213da8f697f (diff)
downloadaurweb-3c1b84bc7ec119c6cf2a9ad62f0a92c62d16c6d5.tar.xz
Go to details page when a search returns one result.
Signed-off-by: Loui Chang <louipc.ist@gmail.com>
-rw-r--r--web/lib/pkgfuncs.inc12
1 files changed, 9 insertions, 3 deletions
diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc
index 05705d0..24b4739 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;
}