summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoreric <eric>2004-06-25 16:41:37 +0000
committereric <eric>2004-06-25 16:41:37 +0000
commit5cbbf11c8bf72a1b80dc72e27d5737c7d79a5903 (patch)
treeb5ec1fa983c02bfff89064df9dc8a2a5b0c6875c
parente7f806e43c8ccf0d4c8eb49b0020a99deb88a987 (diff)
downloadaurweb-5cbbf11c8bf72a1b80dc72e27d5737c7d79a5903.tar.xz
less/more buttons work on packages
-rw-r--r--web/lib/aur.inc9
-rw-r--r--web/lib/pkgs.inc54
2 files changed, 56 insertions, 7 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index def41c6..f59e63a 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 "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\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 "<a href='/index.php?setlang=en'><span class='sideBarSmallHeader'>English</span></a> ";
- print "<a href='/index.php?setlang=es'><span class='sideBarSmallHeader'>Español</span></a> ";
- print "<a href='/index.php?setlang=de'><span class='sideBarSmallHeader'>Deutsch</span></a> ";
- print "<a href='/index.php?setlang=fr'><span class='sideBarSmallHeader'>Français</span></a>";
+ print "<a href='".$_SERVER["PHP_SELF"]."?setlang=en'><span class='sideBarSmallHeader'>English</span></a> ";
+ print "<a href='".$_SERVER["PHP_SELF"]."?setlang=es'><span class='sideBarSmallHeader'>Español</span></a> ";
+ print "<a href='".$_SERVER["PHP_SELF"]."?setlang=de'><span class='sideBarSmallHeader'>Deutsch</span></a> ";
+ print "<a href='".$_SERVER["PHP_SELF"]."?setlang=fr'><span class='sideBarSmallHeader'>Français</span></a>";
print " </td>\n";
print " </tr>\n";
print " </table>\n";
diff --git a/web/lib/pkgs.inc b/web/lib/pkgs.inc
index 47dd06a..c11143e 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 "<center>\n";
print "<table cellspacing='3' class='boxSoft'>\n";
print "<tr>\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."<br />\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 "<center>\n";
@@ -252,7 +263,44 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) {
}
print "</table>\n";
+ print " </td>\n";
+ print "</tr>\n";
+ print "</table>\n";
+ print "<br />\n";
+ print "<table width='90%' cellspacing='0' cellpadding='2'>\n";
+ print "<tr>\n";
+ print " <td>\n";
+ print " <table border='0' cellpadding='0' cellspacing='0' width='100%'>\n";
+ print " <tr>\n";
+ print " <td align='left'>";
+ print " <form action='/pkgsearch.php' method='post'>\n";
+ print " <input type='hidden' name='Action' value='SearchPkgs'>\n";
+ print " <input type='hidden' name='O' value='".($OFFSET-intval($PP))."'>\n";
+ print " <input type='hidden' name='L' value='".$L."'>\n";
+ print " <input type='hidden' name='C' value='".$C."'>\n";
+ print " <input type='hidden' name='K' value='".$K."'>\n";
+ print " <input type='hidden' name='SB' value='".$SB."'>\n";
+ print " <input type='hidden' name='PP' value='".$PP."'>\n";
+ print " <input type='submit' class='button'";
+ print " value='&lt;-- ".__("Less")."'>\n";
+ print " </form>\n";
+ print " </td>\n";
+ print " <td align='right'>";
+ print " <form action='/pkgsearch.php' method='post'>\n";
+ print " <input type='hidden' name='Action' value='SearchPkgs'>\n";
+ print " <input type='hidden' name='O' value='".($OFFSET+intval($PP))."'>\n";
+ print " <input type='hidden' name='L' value='".$L."'>\n";
+ print " <input type='hidden' name='C' value='".$C."'>\n";
+ print " <input type='hidden' name='K' value='".$K."'>\n";
+ print " <input type='hidden' name='SB' value='".$SB."'>\n";
+ print " <input type='hidden' name='PP' value='".$PP."'>\n";
+ print " <input type='submit' class='button'";
+ print " value='".__("More")." --&gt;'>\n";
+ print " </form>\n";
+ print " </td>\n";
+ print " </tr>\n";
+ print " </table>\n";
print " </td>\n";
print "</tr>\n";
print "</table>\n";