diff options
author | friendica <info@friendica.com> | 2014-08-22 15:51:48 -0700 |
---|---|---|
committer | friendica <info@friendica.com> | 2014-08-22 15:51:48 -0700 |
commit | 2dc705d9a04df4b5d5415a42ddd2cb86c99222e8 (patch) | |
tree | bbcfccf467312c2e2aae9a99ec6d6c670c249e74 /include/items.php | |
parent | 9dbfed64bee54d9293bae311bfc48a262fdd64bb (diff) | |
download | volse-hubzilla-2dc705d9a04df4b5d5415a42ddd2cb86c99222e8.tar.gz volse-hubzilla-2dc705d9a04df4b5d5415a42ddd2cb86c99222e8.tar.bz2 volse-hubzilla-2dc705d9a04df4b5d5415a42ddd2cb86c99222e8.zip |
issue #571 - use feed/nickname?top=1
Diffstat (limited to 'include/items.php')
-rwxr-xr-x | include/items.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/include/items.php b/include/items.php index 783c67752..c0bc0ef83 100755 --- a/include/items.php +++ b/include/items.php @@ -400,6 +400,7 @@ function get_public_feed($channel,$params) { $params['records'] = ((x($params,'records')) ? $params['records'] : 40); $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); switch($params['type']) { case 'json': @@ -440,7 +441,8 @@ function get_feed_for($channel, $observer_hash, $params) { 'records' => $params['records'], // FIXME 'direction' => $params['direction'], // FIXME 'pages' => $params['pages'], - 'order' => 'post' + 'order' => 'post', + 'top' => $params['top'] ), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module); @@ -4186,6 +4188,9 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C $parents_str = ids_to_querystr($r,'item_id'); + if($arr['top']) + $sql_extra = ' and id = parent ' . $sql_extra; + $items = q("SELECT item.*, item.id AS item_id FROM item WHERE $item_uids $item_restrict AND item.parent IN ( %s ) |