aboutsummaryrefslogtreecommitdiffstats
path: root/include/items.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-03-18 16:50:46 -0700
committerfriendica <info@friendica.com>2014-03-18 16:50:46 -0700
commit8c177fbc4b20c297afbd7035dbb5e59d94fb4020 (patch)
tree534ced0ada038c99bd466082494546feca0cffd9 /include/items.php
parentc8fb979ed86403bc38baaf92c90f299434b25fdf (diff)
downloadvolse-hubzilla-8c177fbc4b20c297afbd7035dbb5e59d94fb4020.tar.gz
volse-hubzilla-8c177fbc4b20c297afbd7035dbb5e59d94fb4020.tar.bz2
volse-hubzilla-8c177fbc4b20c297afbd7035dbb5e59d94fb4020.zip
cleanup
Diffstat (limited to 'include/items.php')
-rwxr-xr-xinclude/items.php28
1 files changed, 15 insertions, 13 deletions
diff --git a/include/items.php b/include/items.php
index 70e098415..6788ac3da 100755
--- a/include/items.php
+++ b/include/items.php
@@ -3931,23 +3931,25 @@ function items_fetch($arr,$channel = null,$observer_hash = null,$client_mode = C
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)) {
+ if(array_key_exists('cmin',$arr) || array_key_exists('cmax',$arr)) {
+ if(($arr['cmin'] != 0) || ($arr['cmax'] != 99)) {
- // Not everybody who shows up in the network stream will be in your address book.
- // By default those that aren't are assumed to have closeness = 99; but this isn't
- // recorded anywhere. So if cmax is 99, we'll open the search up to anybody in
- // the stream with a NULL address book entry.
+ // Not everybody who shows up in the network stream will be in your address book.
+ // By default those that aren't are assumed to have closeness = 99; but this isn't
+ // recorded anywhere. So if cmax is 99, we'll open the search up to anybody in
+ // the stream with a NULL address book entry.
- $sql_nets .= " AND ";
+ $sql_nets .= " AND ";
- if($arr['cmax'] == 99)
- $sql_nets .= " ( ";
+ if($arr['cmax'] == 99)
+ $sql_nets .= " ( ";
- $sql_nets .= "( abook.abook_closeness >= " . intval($arr['cmin']) . " ";
- $sql_nets .= " AND abook.abook_closeness <= " . intval($arr['cmax']) . " ) ";
- if($cmax == 99)
- $sql_nets .= " OR abook.abook_closeness IS NULL ) ";
- }
+ $sql_nets .= "( abook.abook_closeness >= " . intval($arr['cmin']) . " ";
+ $sql_nets .= " AND abook.abook_closeness <= " . intval($arr['cmax']) . " ) ";
+ if($cmax == 99)
+ $sql_nets .= " OR abook.abook_closeness IS NULL ) ";
+ }
+ }
$simple_update = (($client_mode & CLIENT_MODE_UPDATE) ? " and ( item.item_flags & " . intval(ITEM_UNSEEN) . " ) " : '');
if($client_mode & CLIENT_MODE_LOAD)