Fixed bug where search resets when browsing orphans

Signed-off-by: Loui Chang <louipc.ist@gmail.com>
Signed-off-by: Simo Leone <simo@archlinux.org>
This commit is contained in:
Loui Chang 2008-02-28 12:00:02 -05:00 committed by Simo Leone
parent e64307d8d2
commit b1fe84d397

View file

@ -631,7 +631,7 @@ function pkg_search_page($SID="") {
$_REQUEST["do_Orphans"] = 0; $_REQUEST["do_Orphans"] = 0;
$O = 0; $O = 0;
} }
if ($_REQUEST["do_Orphans"] && $_REQUEST["do_Orphans"] != 1) { if (!empty($_REQUEST['do_Orphans']) && $_REQUEST['do_Orphans'] != 1) {
# reset the offset to zero if they hit Orphans # reset the offset to zero if they hit Orphans
# #
$_REQUEST["do_Search"] = 0; $_REQUEST["do_Search"] = 0;
@ -1123,7 +1123,12 @@ function pkg_search_page($SID="") {
# RIGHT # RIGHT
print " <td align='right'>"; print " <td align='right'>";
if (mysql_num_rows(db_query($qnext, $dbh))) { if (mysql_num_rows(db_query($qnext, $dbh))) {
print "<a href='/packages.php?O=" . ($O + $PP) . "&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"])."&K=$K&SB=$SB&SO=$SO&PP=$PP&SeB=".$_REQUEST["SeB"]."&do_MyPackages=".$_REQUEST["do_MyPackages"]."&do_Orphans=".$_REQUEST["do_Orphans"]."'>" . __("More") . "</a>"; print "<a href='/packages.php?O=" . ($O + $PP) .
"&L=".intval($_REQUEST["L"])."&C=".intval($_REQUEST["C"]) .
"&K=$K&SB=$SB&SO=$SO&PP=$PP&SeB=".$_REQUEST["SeB"] .
"&do_MyPackages=".$_REQUEST["do_MyPackages"] .
"&do_Orphans=".isset($_REQUEST["do_Orphans"])."'>" .
__("More") . "</a>";
} }
print " </td>\n"; print " </td>\n";
print " </tr>\n"; print " </tr>\n";