aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorHaakon Meland Eriksen <haakon.eriksen@far.no>2015-12-01 00:35:01 +0100
committerHaakon Meland Eriksen <haakon.eriksen@far.no>2015-12-01 00:35:01 +0100
commitb96f09bb3aeee403038755ab5f6e6b53654cb145 (patch)
treeca72f5712b7467e7f968f87172cec82164435894 /include/items.php
parent519862115c143cf3f645a172f39e5a0b4dc9d5bb (diff)
parent4b191fb55860c5f366c17ecaacc59ccbdd936885 (diff)
downloadvolse-hubzilla-b96f09bb3aeee403038755ab5f6e6b53654cb145.tar.gz
volse-hubzilla-b96f09bb3aeee403038755ab5f6e6b53654cb145.tar.bz2
volse-hubzilla-b96f09bb3aeee403038755ab5f6e6b53654cb145.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php
index 7d349c631..46b396ad2 100755
--- a/include/items.php
+++ b/include/items.php
@@ -550,6 +550,7 @@ function get_public_feed($channel, $params) {
$params['direction'] = ((x($params,'direction')) ? $params['direction'] : 'desc');
$params['pages'] = ((x($params,'pages')) ? intval($params['pages']) : 0);
$params['top'] = ((x($params,'top')) ? intval($params['top']) : 0);
+ $params['cat'] = ((x($params,'cat')) ? $params['cat'] : '');
switch($params['type']) {
case 'json':
@@ -593,7 +594,8 @@ function get_feed_for($channel, $observer_hash, $params) {
'direction' => $params['direction'], // FIXME
'pages' => $params['pages'],
'order' => 'post',
- 'top' => $params['top']
+ 'top' => $params['top'],
+ 'cat' => $params['cat']
), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module);
@@ -4817,6 +4819,9 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
if($arr['since_id'])
$sql_extra .= " and item.id > " . $since_id . " ";
+ if($arr['cat'])
+ $sql_extra .= protect_sprintf(term_query('item', $arr['cat'], TERM_CATEGORY));
+
if($arr['gid'] && $uid) {
$r = q("SELECT * FROM `groups` WHERE id = %d AND uid = %d LIMIT 1",
intval($arr['group']),