summaryrefslogtreecommitdiffstats
path: root/web/lib
diff options
context:
space:
mode:
authoreric <eric>2004-06-25 00:17:17 +0000
committereric <eric>2004-06-25 00:17:17 +0000
commit16a97cf1a38313dbe8cab0f29f1054e61a3964f6 (patch)
treea6e535a9b130f20b204ca860573425a1b99cedb5 /web/lib
parent1f62f86af5225643f2a7d72c1a050c46ffc37477 (diff)
downloadaurweb-16a97cf1a38313dbe8cab0f29f1054e61a3964f6.tar.xz
first pass at displaying package search results - still needs Less/More buttons
Diffstat (limited to 'web/lib')
-rw-r--r--web/lib/aur.inc4
-rw-r--r--web/lib/pkgs.inc71
2 files changed, 49 insertions, 26 deletions
diff --git a/web/lib/aur.inc b/web/lib/aur.inc
index 39c5c92..def41c6 100644
--- a/web/lib/aur.inc
+++ b/web/lib/aur.inc
@@ -33,7 +33,7 @@ function getTrustedUsers() {
$result = db_query($q, $dbh);
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
- $tus[] = $row;
+ $tus[$row["ID"]] = $row;
}
}
return $tus;
@@ -50,7 +50,7 @@ function getDevelopers() {
$result = db_query($q, $dbh);
if ($result) {
while ($row = mysql_fetch_assoc($result)) {
- $devs[] = $row;
+ $devs[$row["ID"]] = $row;
}
}
return $devs;
diff --git a/web/lib/pkgs.inc b/web/lib/pkgs.inc
index bd63ee2..b9d061e 100644
--- a/web/lib/pkgs.inc
+++ b/web/lib/pkgs.inc
@@ -114,7 +114,7 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) {
print __("Location")."\n";
print " <option value=p";
$SB == "p" ? print "selected> " : print "> ";
- print __("Popularity")."\n";
+ print __("Votes")."\n";
print " </select>\n";
print "</td>\n";
@@ -147,17 +147,9 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) {
print "</center>\n";
print "<br />\n";
- print "<center>\n";
- print "<table cellspacing='3' class='boxSoft'>\n";
- print "<tr>\n";
- print " <td class='boxSoftTitle' align='right'>\n";
- print " <span class='f3'Package Listing</span>\n";
- print " </td>\n";
- print " <td class='boxSoft'>\n";
-
# query to pull out package info
#
- $q = "SELECT Packages.*, IF(ISNULL(PackageID), 0, COUNT(*)) AS Popularity ";
+ $q = "SELECT Packages.*, IF(ISNULL(PackageID), 0, COUNT(*)) AS Votes ";
$q.= "FROM Packages LEFT JOIN PackageVotes ";
$q.= "ON Packages.ID = PackageVotes.PackageID ";
$has_where = 0;
@@ -209,18 +201,54 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) {
print "<table cellspacing='3' class='boxSoft'>\n";
print "<tr>\n";
print " <td class='boxSoftTitle' align='right'>\n";
- print " <span class='f3'Package Listing</span>\n";
+ print " <span class='f3'>Package Listing</span>\n";
print " </td>\n";
+ print "</tr>\n";
+ print "<tr>\n";
print " <td class='boxSoft'>\n";
+ print "<table width='100%' cellspacing='0' cellpadding='2'>\n";
+ print "<tr>\n";
+ print " <th style='border-bottom: #666 1px solid; vertical-align:";
+ print " bottom'><span class='f2'>".__("Location")."</span></th>\n";
+ print " <th style='border-bottom: #666 1px solid; vertical-align:";
+ print " bottom'><span class='f2'>".__("Category")."</span></th>\n";
+ print " <th style='border-bottom: #666 1px solid; vertical-align:";
+ print " bottom'><span class='f2'>".__("Name")."</span></th>\n";
+ print " <th style='border-bottom: #666 1px solid; vertical-align:";
+ print " bottom'><span class='f2'>".__("Votes")."</span></th>\n";
+ print " <th style='border-bottom: #666 1px solid; vertical-align:";
+ print " bottom'><span class='f2'>".__("Description")."</span></th>\n";
+ print " <th style='border-bottom: #666 1px solid; vertical-align:";
+ print " bottom'><span class='f2'>".__("Maintainer")."</span></th>\n";
+ print "</tr>\n";
-# for ($i=0; $row = mysql_fetch_assoc($result); $i++) {
-# (($i % 2) == 0) ? $c = "data1" : $c = "data2";
-# print "<tr>\n";
-# print "<td ";
-# print "</tr>\n";
-#
-# }
- print "Yippie! You found some packages!";
+ for ($i=0; $row = mysql_fetch_assoc($result); $i++) {
+ (($i % 2) == 0) ? $c = "data1" : $c = "data2";
+ print "<tr>\n";
+ print " <td class='".$c."'><span class='f5'><span class='blue'>";
+ print $locs[$row["LocationID"]]."</span></span></td>\n";
+ print " <td class='".$c."'><span class='f5'><span class='blue'>";
+ print $cats[$row["CategoryID"]]."</span></span></td>\n";
+ print " <td class='".$c."'><span class='f4'><span class='blue'>";
+ print $row["Name"]."-".$row["Version"]."</span></span></td>\n";
+ print " <td class='".$c."'><span class='f5'><span class='blue'>";
+ print "&nbsp;&nbsp;&nbsp;".$row["Votes"]."</span></span></td>\n";
+ print " <td class='".$c."'><span class='f4'><span class='blue'>";
+ print $row["Description"]."</span></span></td>\n";
+ print " <td class='".$c."'><span class='f5'><span class='blue'>";
+ if (isset($devs[$row["MaintainerUID"]])) {
+ print $devs[$row["MaintainerUID"]]["Username"];
+ } elseif (isset($tus[$row["MaintainerUID"]])) {
+ print $tus[$row["MaintainerUID"]]["Username"];
+ } else {
+ print "None";
+ }
+ print "</span></span></td>\n";
+
+ print "</tr>\n";
+
+ }
+ print "</table>\n";
print " </td>\n";
print "</tr>\n";
@@ -228,11 +256,6 @@ function pkg_search_page($L="",$C="",$K="",$SB="",$O=0,$PP=25) {
print "</center>\n";
}
-
- print " </td>\n";
- print "</tr>\n";
- print "</table>\n";
- print "</center>\n";
return;
}