From 761ddc3ddcaeb46f48fc746ad2f3cedb97cb1249 Mon Sep 17 00:00:00 2001 From: eric Date: Tue, 29 Jun 2004 21:22:31 +0000 Subject: yet another schema change --- web/lib/pkgfuncs.inc | 60 ++++++++++++++++++++++------------------------------ 1 file changed, 25 insertions(+), 35 deletions(-) (limited to 'web/lib') diff --git a/web/lib/pkgfuncs.inc b/web/lib/pkgfuncs.inc index c8427ab..2b6dd2b 100644 --- a/web/lib/pkgfuncs.inc +++ b/web/lib/pkgfuncs.inc @@ -38,14 +38,7 @@ function pkgLocations() { function pkg_search_page($SID="") { global $_REQUEST; # SID: session id cookie - # L: PackageLocations.ID - # C: PackageCategories.ID - # K: Keywords - # SB: Sort by - # M: search "my packages" - # O: Row offset - # PP: Per page - # D: Direction to advance (Less/More) + $locs = pkgLocations(); $cats = pkgCategories(); $devs = getDevelopers(); @@ -56,6 +49,8 @@ function pkg_search_page($SID="") { # determine paging variables # isset($_REQUEST["PP"]) ? $PP = intval($_REQUEST["PP"]) : $PP = 25; + if ($PP < 25) {$PP = 25;} + if ($PP > 100) {$PP = 100;} isset($_REQUEST["O"]) ? $O = intval($_REQUEST["O"]) : $O = 0; if (isset($_REQUEST["do_More"])) { $O += $PP; @@ -65,6 +60,11 @@ function pkg_search_page($SID="") { if ($O < 0) { $O = 0; } + if (isset($_REQUEST["do_Search"]) || isset($_REQUEST["do_MyPackages"])) { + # reset the offset to zero if they hit Go/My Packages + # + $O = 0; + } # grab info for user if they're logged in @@ -76,16 +76,8 @@ function pkg_search_page($SID="") { # The search form # - $K = str_replace("\"", "", $_REQUEST["K"]); # TODO better testing for - # SQL trickery... print "
\n"; print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; print "
\n"; print "\n"; @@ -105,7 +97,7 @@ function pkg_search_page($SID="") { print " \n"; print "
\n"; print "\n"; -- cgit v1.2.3-70-g09d2