From 5cbbf11c8bf72a1b80dc72e27d5737c7d79a5903 Mon Sep 17 00:00:00 2001 From: eric Date: Fri, 25 Jun 2004 16:41:37 +0000 Subject: less/more buttons work on packages --- web/lib/aur.inc | 9 +++++---- web/lib/pkgs.inc | 54 +++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 56 insertions(+), 7 deletions(-) (limited to 'web') diff --git a/web/lib/aur.inc b/web/lib/aur.inc index def41c6f..f59e63a6 100644 --- a/web/lib/aur.inc +++ b/web/lib/aur.inc @@ -294,6 +294,7 @@ function set_lang() { # common header # function html_header() { + global $_SERVER; global $_COOKIE; global $LANG; print "\n"; @@ -332,10 +333,10 @@ function html_header() { # XXX CSS help - a:link, a:visited, etc are defined, but I don't want to # use the defaults. Is this the way to override them? # - print "English "; - print "Español "; - print "Deutsch "; - print "Français"; + print "English "; + print "Español "; + print "Deutsch "; + print "Français"; print " \n"; print " \n"; print " \n"; diff --git a/web/lib/pkgs.inc b/web/lib/pkgs.inc index 47dd06a3..c11143e5 100644 --- a/web/lib/pkgs.inc +++ b/web/lib/pkgs.inc @@ -48,6 +48,15 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) { $tus = getTrustedUsers(); $dbh = db_connect(); + if ($O) { + $OFFSET = intval($O); + } else { + $OFFSET = 0; + } + if ($OFFSET < 0) { + $OFFSET = 0; + } + print "
\n"; print "\n"; print "\n"; @@ -191,13 +200,15 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) { $q.= "ORDER BY Name ASC, LocationID ASC, CategoryID ASC "; break; } - $q.= "LIMIT ".intval($O).", ".intval($PP); + $q.= "LIMIT ".$OFFSET.", ".intval($PP); $result = db_query($q, $dbh); if (!$result) { - print $q."
\n"; print __("No packages matched your search criteria."); - } else { + } elseif (!mysql_num_rows($result)) { + print __("No packages matched your search criteria."); + + } else { # print out package search results # print "
\n"; @@ -252,7 +263,44 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) { } print "
\n"; + print " \n"; + print "\n"; + print "\n"; + print "
\n"; + print "\n"; + print "\n"; + print " \n"; print "\n"; print "
\n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print "
"; + print "
\n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print "
\n"; + print "
"; + print "
\n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print " \n"; + print "
\n"; + print "
\n"; print "
\n"; -- cgit v1.2.3-24-g4f1b