Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Arch Linux
aurweb
Commits
24599ab6
Commit
24599ab6
authored
Apr 15, 2010
by
Andrea Scarpino
Committed by
Loui Chang
Apr 15, 2010
Browse files
add search only by name
Signed-off-by:
Loui Chang
<
louipc.ist@gmail.com
>
parent
9444f924
Changes
2
Hide whitespace changes
Inline
Side-by-side
web/lib/pkgfuncs.inc
View file @
24599ab6
...
...
@@ -365,7 +365,8 @@ function package_details($id=0, $SID="") {
* v - number of votes
* m - maintainer username
* SeB- property that search string (K) represents
* values: nd - package name&description
* values: n - package name
* nd - package name & description
* m - package maintainer's username
* s - package submitter's username
* do_Orphans - boolean. whether to search packages
...
...
@@ -466,12 +467,17 @@ function pkg_search_page($SID="") {
if
(
$_GET
[
"SeB"
]
==
"m"
)
{
$q
.
=
"AND Users.Username = '"
.
$_GET
[
'K'
]
.
"' "
;
}
# Search by submitter
elseif
(
$_GET
[
"SeB"
]
==
"s"
)
{
// FIXME: this shouldn't be making 2 queries
// kill the call to uid_from_username
$q
.
=
"AND SubmitterUID = "
.
uid_from_username
(
$_GET
[
'K'
])
.
" "
;
// the default behavior, query the name/description
# Search by name
}
elseif
(
$_GET
[
"SeB"
]
==
"n"
)
{
$q
.
=
"AND (Name LIKE '%"
.
$_GET
[
'K'
]
.
"%') "
;
}
# Search by name and description (Default)
else
{
$q
.
=
"AND (Name LIKE '%"
.
$_GET
[
'K'
]
.
"%' OR "
;
$q
.
=
"Description LIKE '%"
.
$_GET
[
'K'
]
.
"%') "
;
...
...
web/template/pkg_search_form.php
View file @
24599ab6
...
...
@@ -39,7 +39,7 @@
<label>
<?php
print
__
(
"Search by"
);
?>
</label>
<select
name=
'SeB'
>
<?php
$searchby
=
array
(
'nd'
=>
'Name'
,
'm'
=>
'Maintainer'
,
's'
=>
'Submitter'
);
$searchby
=
array
(
'nd'
=>
'Name
& Desc'
,
'n'
=>
'Name Only
'
,
'm'
=>
'Maintainer'
,
's'
=>
'Submitter'
);
foreach
(
$searchby
as
$k
=>
$v
)
:
if
(
$_REQUEST
[
'SeB'
]
==
$k
)
:
?>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment