aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-01-25 15:51:10 -0800
committerfriendica <info@friendica.com>2014-01-25 15:51:10 -0800
commit339a0f69c194d098333ed4d81b86cbc12f1339f3 (patch)
tree7753ba518e64ff5e4f876b5b99e85ba86e5cec42 /include/items.php
parent6911439f0e5bce19cdefb722378d695f5f7db65e (diff)
downloadvolse-hubzilla-339a0f69c194d098333ed4d81b86cbc12f1339f3.tar.gz
volse-hubzilla-339a0f69c194d098333ed4d81b86cbc12f1339f3.tar.bz2
volse-hubzilla-339a0f69c194d098333ed4d81b86cbc12f1339f3.zip
some tweaks to items_fetch for the api
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php7
1 files changed, 5 insertions, 2 deletions
diff --git a/include/items.php b/include/items.php
index 364ff9f3f..2fe923303 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3818,6 +3818,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
);
}
+
if(($client_mode & CLIENT_MODE_UPDATE) && (! ($client_mode & CLIENT_MODE_LOAD))) {
// only setup pagination on initial page view
@@ -3830,6 +3831,8 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
$pager_sql = sprintf(" LIMIT %d, %d ",intval(get_app()->pager['start']), intval(get_app()->pager['itemspage']));
}
+ if(isset($arr['start']) && isset($arr['records']))
+ $pager_sql = sprintf(" LIMIT %d, %d ",intval($arr['start']), intval($arr['records']));
if(($arr['cmin'] != 0) || ($arr['cmax'] != 99)) {
@@ -3864,7 +3867,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
$item_restrict = " AND item_restrict = 0 ";
- if($arr['nouveau'] && ($client_mode & CLIENT_MODELOAD) && $channel) {
+ if($arr['nouveau'] && ($client_mode & CLIENT_MODE_LOAD) && $channel) {
// "New Item View" - show all items unthreaded in reverse created date order
$items = q("SELECT item.*, item.id AS item_id FROM item
@@ -3889,7 +3892,7 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
else
$ordering = "commented";
- if(($client_mode & CLIENT_MODE_LOAD) || ($client_mode & CLIENT_MODE_NORMAL)) {
+ if(($client_mode & CLIENT_MODE_LOAD) || ($client_mode == CLIENT_MODE_NORMAL)) {
// Fetch a page full of parent items for this page