[aur-dev] [PATCH 1/3] JSON-RPC: include maintainer info in results.
Christopher Brannon
chris at the-brannons.com
Fri Nov 5 18:28:28 CET 2010
This patch implements the feature requested in FS#17597.
The name of the maintainer is now included in the results of the
search and info queries.
---
web/lib/aurjson.class.php | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index a5b3f9e..369f6ae 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -96,7 +96,9 @@ class AurJSON {
$keyword_string = mysql_real_escape_string($keyword_string, $this->dbh);
$query = "SELECT " . implode(',', $this->fields) .
- " FROM Packages WHERE DummyPkg=0 AND " .
+ ", Users.Username AS Maintainer" .
+ " FROM Packages LEFT JOIN Users ON MaintainerUID = Users.ID" .
+ " WHERE DummyPkg=0 AND " .
" ( Name LIKE '%{$keyword_string}%' OR " .
" Description LIKE '%{$keyword_string}%' )";
$result = db_query($query, $this->dbh);
@@ -122,7 +124,9 @@ class AurJSON {
**/
private function info($pqdata) {
$base_query = "SELECT " . implode(',', $this->fields) .
- " FROM Packages WHERE DummyPkg=0 AND ";
+ ", Users.Username AS Maintainer" .
+ " FROM Packages LEFT JOIN Users on Packages.MaintainerUID = Users.ID" .
+ " WHERE DummyPkg=0 AND ";
if ( is_numeric($pqdata) ) {
// just using sprintf to coerce the pqd to an int
--
1.7.3.2
More information about the aur-dev
mailing list