diff options
Diffstat (limited to 'web')
-rw-r--r-- | web/html/pkgsearch.php | 9 | ||||
-rw-r--r-- | web/lang/pkgs_po.inc | 15 | ||||
-rw-r--r-- | web/lib/aur.inc | 4 | ||||
-rw-r--r-- | web/lib/pkgs.inc | 71 |
4 files changed, 72 insertions, 27 deletions
diff --git a/web/html/pkgsearch.php b/web/html/pkgsearch.php index 6b23265d..91a2d58e 100644 --- a/web/html/pkgsearch.php +++ b/web/html/pkgsearch.php @@ -29,16 +29,23 @@ if (isset($_COOKIE["AURSID"])) { if ($atype && $_REQUEST["Action"] == "Something") { # do something based on what the user specifies # + } elseif ($atype && $_REQUEST["Action"] == "SomethingElse") { # do something else based on what the user specifies # + +} elseif ($_REQUEST["Action"] == "SearchPkgs") { + # do something else based on what the user specifies + # + pkg_search_page($_REQUEST["L"], $_REQUEST["C"], $_REQUEST["K"], + $_REQUEST["SB"], $_REQUEST["O"], $_REQUEST["PP"]); + } else { # do the default thing - give the user a search form that they # can specify: location, category, maintainer, name, 'my pkgs' # pkg_search_page(); } -print __("Under construction...")."<br />\n"; html_footer("\$Id$"); diff --git a/web/lang/pkgs_po.inc b/web/lang/pkgs_po.inc index 432ee283..94294c74 100644 --- a/web/lang/pkgs_po.inc +++ b/web/lang/pkgs_po.inc @@ -61,4 +61,19 @@ $_t["en"]["Any"] = "Any"; # $_t["fr"]["Any"] = "--> Traduction française ici. <--"; # $_t["de"]["Any"] = "--> Deutsche Übersetzung hier. <--"; +$_t["en"]["Votes"] = "Votes"; +# $_t["es"]["Votes"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Votes"] = "--> Traduction française ici. <--"; +# $_t["de"]["Votes"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["Description"] = "Description"; +# $_t["es"]["Description"] = "--> Traducción española aquí. <--"; +# $_t["fr"]["Description"] = "--> Traduction française ici. <--"; +# $_t["de"]["Description"] = "--> Deutsche Übersetzung hier. <--"; + +$_t["en"]["No packages matched your search criteria."] = "No packages matched your search criteria."; +# $_t["es"]["No packages matched your search criteria."] = "--> Traducción española aquí. <--"; +# $_t["fr"]["No packages matched your search criteria."] = "--> Traduction française ici. <--"; +# $_t["de"]["No packages matched your search criteria."] = "--> Deutsche Übersetzung hier. <--"; + ?>
\ No newline at end of file diff --git a/web/lib/aur.inc b/web/lib/aur.inc index 39c5c92f..def41c6f 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 bd63ee2e..b9d061e1 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 " ".$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; } |