From 3c1b84bc7ec119c6cf2a9ad62f0a92c62d16c6d5 Mon Sep 17 00:00:00 2001 From: Loui Chang Date: Tue, 3 Mar 2009 12:55:14 -0500 Subject: Go to details page when a search returns one result. Signed-off-by: Loui Chang --- web/lib/pkgfuncs.inc | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'web/lib/pkgfuncs.inc') 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; } -- cgit v1.2.3-24-g4f1b