aboutsummaryrefslogtreecommitdiffstats
path: root/include/api.php
diff options
context:
space:
mode:
authorZvi ben Yaakov (a.k.a rdc) <coderzvi@infosoc.net>2012-06-21 13:38:14 +0300
committerZvi ben Yaakov (a.k.a rdc) <coderzvi@infosoc.net>2012-06-21 13:38:14 +0300
commit5e3e3915e347e4c298498ce0a8c493b9cd03201b (patch)
tree5a7aabb78964ab82caebac84299015af4f87882d /include/api.php
parentd20cdf09eafbc57c1b6dbcb78a5cdaa731ae876d (diff)
parent53c9ea760659b39deeab9cff5d4f26d5abd63d31 (diff)
downloadvolse-hubzilla-5e3e3915e347e4c298498ce0a8c493b9cd03201b.tar.gz
volse-hubzilla-5e3e3915e347e4c298498ce0a8c493b9cd03201b.tar.bz2
volse-hubzilla-5e3e3915e347e4c298498ce0a8c493b9cd03201b.zip
Merge git://github.com/friendica/friendica
Diffstat (limited to 'include/api.php')
-rw-r--r--include/api.php11
1 files changed, 9 insertions, 2 deletions
diff --git a/include/api.php b/include/api.php
index 855e4efa3..691543907 100644
--- a/include/api.php
+++ b/include/api.php
@@ -719,14 +719,18 @@
if ($page<0) $page=0;
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$max_id = (x($_REQUEST,'max_id')?$_REQUEST['max_id']:0);
+ $exclude_replies = (x($_REQUEST,'exclude_replies')?1:0);
//$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
//$include_entities = (x($_REQUEST,'include_entities')?$_REQUEST['include_entities']:false);
+ $sql_extra = '';
if ($max_id > 0)
- $sql_extra = 'AND `item`.`id` <= '.intval($max_id);
+ $sql_extra .= ' AND `item`.`id` <= '.intval($max_id);
+ if ($exclude_replies > 0)
+ $sql_extra .= ' AND `item`.`parent` = `item`.`id`';
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,
@@ -1061,11 +1065,14 @@
$page = (x($_REQUEST,'page')?$_REQUEST['page']-1:0);
if ($page<0) $page=0;
$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
+ $exclude_replies = (x($_REQUEST,'exclude_replies')?1:0);
//$since_id = 0;//$since_id = (x($_REQUEST,'since_id')?$_REQUEST['since_id']:0);
$start = $page*$count;
- if ($user_info['self']==1) $sql_extra = "AND `item`.`wall` = 1 ";
+ $sql_extra = '';
+ if ($user_info['self']==1) $sql_extra .= " AND `item`.`wall` = 1 ";
+ if ($exclude_replies > 0) $sql_extra .= ' AND `item`.`parent` = `item`.`id`';
$r = q("SELECT `item`.*, `item`.`id` AS `item_id`,
`contact`.`name`, `contact`.`photo`, `contact`.`url`, `contact`.`rel`,