From 70af7c7d5c5945039f494ca5f9e435bc515db18e Mon Sep 17 00:00:00 2001 From: simo Date: Sun, 27 Nov 2005 04:05:27 +0000 Subject: add search by submitter functionality --- web/lib/pkgfuncs.inc | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'web/lib/pkgfuncs.inc') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index 19d205d4..d3399222 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -677,6 +677,9 @@ function pkg_search_page($SID="") { print " \n"; + print " \n"; print " \n"; print "\n"; @@ -800,14 +803,20 @@ function pkg_search_page($SID="") { #search by maintainer if ($_REQUEST["SeB"] == "m"){ if (!$has_where) { - $q.= "WHERE Username = '".mysql_escape_string($K)."' "; + $q.= "WHERE Username = '".mysql_escape_string($K)."' "; $has_where = 1; - } else { - $q.= "AND Username = '".mysql_escape_string($K)."' "; - } + } else { + $q.= "AND Username = '".mysql_escape_string($K)."' "; + } + } elseif ($_REQUEST["SeB"] == "s") { + if (!$has_where) { + $q.= "WHERE SubmitterUID = ".uid_from_username($K)." "; + $has_where = 1; + } else { + $q.= "AND SubmitterUID = ".uid_from_username($K)." "; } # the default behaivior, query the name/description - else { + } else { if (!$has_where) { $q.= "WHERE (Name LIKE '%".mysql_escape_string($K)."%' OR "; $q.= "Description LIKE '%".mysql_escape_string($K)."%') "; -- cgit v1.2.3-24-g4f1b