From be0459a98b9c047e4cf89b835fd35a32da51ca31 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Sun, 14 Jun 2015 21:08:00 -0700 Subject: convert the abook fields --- mod/viewconnections.php | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'mod/viewconnections.php') diff --git a/mod/viewconnections.php b/mod/viewconnections.php index c1da07292..d9a9aecc1 100644 --- a/mod/viewconnections.php +++ b/mod/viewconnections.php @@ -34,25 +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; + $abook_flags = " and abook_pending = 0 and abook_self = 0 "; $sql_extra = ''; if(! $is_owner) { - $abook_flags = $abook_flags | ABOOK_FLAG_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 xchan_orphan = 0 and xchan_deleted = 0 $sql_extra ", - intval($a->profile['uid']), - intval($abook_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 xchan_orphan = 0 and xchan_deleted = 0 $sql_extra 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($a->pager['itemspage']), intval($a->pager['start']) ); @@ -70,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), -- cgit v1.2.3