summaryrefslogtreecommitdiffstats
path: root/web/lib/aurjson.class.php
diff options
context:
space:
mode:
authorLukas Fleischer <lfleischer@archlinux.org>2015-06-13 15:27:28 +0200
committerLukas Fleischer <lfleischer@archlinux.org>2015-06-14 17:58:55 +0200
commit5fb7a74e23b2059ec0c1acb72d8d804adbf05c52 (patch)
treeae04e34d7dd30bcd0bc913c910c4d9b9feb8a4ee /web/lib/aurjson.class.php
parent4c1bb8b7e510dd85b290f43c2439ca2f017d0dd6 (diff)
downloadaur-5fb7a74e23b2059ec0c1acb72d8d804adbf05c52.tar.gz
aur-5fb7a74e23b2059ec0c1acb72d8d804adbf05c52.tar.xz
Replace categories with keywords
Remove package base categories. Instead, users can now specify up to twenty custom keywords that are taken into consideration when searching. Signed-off-by: Lukas Fleischer <lfleischer@archlinux.org>
Diffstat (limited to 'web/lib/aurjson.class.php')
-rw-r--r--web/lib/aurjson.class.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/web/lib/aurjson.class.php b/web/lib/aurjson.class.php
index f25954c7..c896b042 100644
--- a/web/lib/aurjson.class.php
+++ b/web/lib/aurjson.class.php
@@ -19,7 +19,7 @@ class AurJSON {
private static $fields_v1 = array(
'Packages.ID', 'Packages.Name',
'PackageBases.ID AS PackageBaseID',
- 'PackageBases.Name AS PackageBase', 'Version', 'CategoryID',
+ 'PackageBases.Name AS PackageBase', 'Version',
'Description', 'URL', 'NumVotes', 'OutOfDateTS AS OutOfDate',
'Users.UserName AS Maintainer',
'SubmittedTS AS FirstSubmitted', 'ModifiedTS AS LastModified',
@@ -28,13 +28,13 @@ class AurJSON {
private static $fields_v2 = array(
'Packages.ID', 'Packages.Name',
'PackageBases.ID AS PackageBaseID',
- 'PackageBases.Name AS PackageBase', 'Version', 'CategoryID',
+ 'PackageBases.Name AS PackageBase', 'Version',
'Description', 'URL', 'NumVotes', 'OutOfDateTS AS OutOfDate',
'Users.UserName AS Maintainer',
'SubmittedTS AS FirstSubmitted', 'ModifiedTS AS LastModified'
);
private static $numeric_fields = array(
- 'ID', 'PackageBaseID', 'CategoryID', 'NumVotes', 'OutOfDate',
+ 'ID', 'PackageBaseID', 'NumVotes', 'OutOfDate',
'FirstSubmitted', 'LastModified'
);
@@ -62,7 +62,7 @@ class AurJSON {
if (isset($http_data['v'])) {
$this->version = intval($http_data['v']);
}
- if ($this->version < 1 || $this->version > 3) {
+ if ($this->version < 1 || $this->version > 4) {
return $this->json_error('Invalid version specified.');
}
@@ -229,6 +229,9 @@ class AurJSON {
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$resultcount++;
$row['URLPath'] = sprintf(config_get('options', 'snapshot_uri'), urlencode($row['PackageBase']));
+ if ($this->version < 4) {
+ $row['CategoryID'] = 1;
+ }
/*
* Unfortunately, mysql_fetch_assoc() returns