aboutsummaryrefslogtreecommitdiffstats
path: root/mod/viewconnections.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/viewconnections.php')
-rw-r--r--mod/viewconnections.php21
1 files changed, 9 insertions, 12 deletions
diff --git a/mod/viewconnections.php b/mod/viewconnections.php
index ef6681e64..d9a9aecc1 100644
--- a/mod/viewconnections.php
+++ b/mod/viewconnections.php
@@ -34,26 +34,23 @@ function viewconnections_content(&$a) {
$is_owner = ((local_channel() && local_channel() == $a->profile['uid']) ? true : false);
- $abook_flags = ABOOK_FLAG_PENDING|ABOOK_FLAG_SELF;
- $xchan_flags = XCHAN_FLAGS_ORPHAN|XCHAN_FLAGS_DELETED;
+ $abook_flags = " and abook_pending = 0 and abook_self = 0 ";
+ $sql_extra = '';
+
if(! $is_owner) {
- $abook_flags = $abook_flags | ABOOK_FLAG_HIDDEN;
- $xchan_flags = $xchan_flags | XCHAN_FLAGS_HIDDEN;
+ $abook_flags = " and abook_hidden = 0 ";
+ $sql_extra = " and xchan_hidden = 0 ";
}
- $r = q("SELECT count(*) as total FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not (abook_flags & %d )>0 and not ( xchan_flags & %d )>0 ",
- intval($a->profile['uid']),
- intval($abook_flags),
- intval($xchan_flags)
+ $r = q("SELECT count(*) as total FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d $abook_flags and xchan_orphan = 0 and xchan_deleted = 0 $sql_extra ",
+ intval($a->profile['uid'])
);
if($r) {
$a->set_pager_total($r[0]['total']);
}
- $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d and not ( abook_flags & %d )>0 and not ( xchan_flags & %d )>0 order by xchan_name LIMIT %d OFFSET %d ",
+ $r = q("SELECT * FROM abook left join xchan on abook_xchan = xchan_hash where abook_channel = %d $abook_flags and xchan_orphan = 0 and xchan_deleted = 0 $sql_extra order by xchan_name LIMIT %d OFFSET %d ",
intval($a->profile['uid']),
- intval($abook_flags),
- intval($xchan_flags),
intval($a->pager['itemspage']),
intval($a->pager['start'])
);
@@ -71,7 +68,7 @@ function viewconnections_content(&$a) {
if($url) {
$contacts[] = array(
'id' => $rr['abook_id'],
- 'archived' => (($rr['abook_flags'] & ABOOK_FLAG_ARCHIVED) ? true : false),
+ 'archived' => (intval($rr['abook_archived']) ? true : false),
'img_hover' => sprintf( t('Visit %s\'s profile [%s]'), $rr['xchan_name'], $rr['xchan_url']),
'thumb' => $rr['xchan_photo_m'],
'name' => substr($rr['xchan_name'],0,20),