issue #571 - use feed/nickname?top=1
This commit is contained in:
parent
9dbfed64be
commit
2dc705d9a0
@ -400,6 +400,7 @@ function get_public_feed($channel,$params) {
|
|||||||
$params['records'] = ((x($params,'records')) ? $params['records'] : 40);
|
$params['records'] = ((x($params,'records')) ? $params['records'] : 40);
|
||||||
$params['direction'] = ((x($params,'direction')) ? $params['direction'] : 'desc');
|
$params['direction'] = ((x($params,'direction')) ? $params['direction'] : 'desc');
|
||||||
$params['pages'] = ((x($params,'pages')) ? intval($params['pages']) : 0);
|
$params['pages'] = ((x($params,'pages')) ? intval($params['pages']) : 0);
|
||||||
|
$params['top'] = ((x($params,'top')) ? intval($params['top']) : 0);
|
||||||
|
|
||||||
switch($params['type']) {
|
switch($params['type']) {
|
||||||
case 'json':
|
case 'json':
|
||||||
@ -440,7 +441,8 @@ function get_feed_for($channel, $observer_hash, $params) {
|
|||||||
'records' => $params['records'], // FIXME
|
'records' => $params['records'], // FIXME
|
||||||
'direction' => $params['direction'], // FIXME
|
'direction' => $params['direction'], // FIXME
|
||||||
'pages' => $params['pages'],
|
'pages' => $params['pages'],
|
||||||
'order' => 'post'
|
'order' => 'post',
|
||||||
|
'top' => $params['top']
|
||||||
), $channel, $observer_hash, CLIENT_MODE_NORMAL, get_app()->module);
|
), $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');
|
$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
|
$items = q("SELECT item.*, item.id AS item_id FROM item
|
||||||
WHERE $item_uids $item_restrict
|
WHERE $item_uids $item_restrict
|
||||||
AND item.parent IN ( %s )
|
AND item.parent IN ( %s )
|
||||||
|
@ -11,6 +11,7 @@ function feed_init(&$a) {
|
|||||||
$params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : '');
|
$params['end'] = ((x($_REQUEST,'date_end')) ? $_REQUEST['date_end'] : '');
|
||||||
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
|
$params['type'] = ((stristr(argv(0),'json')) ? 'json' : 'xml');
|
||||||
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
|
$params['pages'] = ((x($_REQUEST,'pages')) ? intval($_REQUEST['pages']) : 0);
|
||||||
|
$params['top'] = ((x($_REQUEST,'top')) ? intval($_REQUEST['top']) : 0);
|
||||||
|
|
||||||
$channel = '';
|
$channel = '';
|
||||||
if(argc() > 1) {
|
if(argc() > 1) {
|
||||||
|
Reference in New Issue
Block a user