From 51848c619080e19cace647966a17eb9a1b42ca25 Mon Sep 17 00:00:00 2001 From: friendica Date: Tue, 20 Jan 2015 19:33:19 -0800 Subject: working through the xchan table to remove bitfields, mostly complete except for updating the updater --- mod/connections.php | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'mod/connections.php') diff --git a/mod/connections.php b/mod/connections.php index d36734ccb..dae6fbd3e 100644 --- a/mod/connections.php +++ b/mod/connections.php @@ -214,11 +214,10 @@ function connections_content(&$a) { nav_set_selected('intros'); break; case 'ifpending': - $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d)>0 and not ((abook_flags & %d)>0 or (xchan_flags & %d)>0)", + $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash where abook_channel = %d and (abook_flags & %d)>0 and not ((abook_flags & %d)>0 or xchan_deleted = 1 or xchan_orphan = 1)", intval(local_user()), intval(ABOOK_FLAG_PENDING), - intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED), - intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) + intval(ABOOK_FLAG_SELF|ABOOK_FLAG_IGNORED) ); if($r && $r[0]['total']) { $search_flags = ABOOK_FLAG_PENDING; @@ -343,10 +342,9 @@ function connections_content(&$a) { } $r = q("SELECT COUNT(abook.abook_id) AS total FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash - where abook_channel = %d and not (abook_flags & %d)>0 and not (xchan_flags & %d )>0 $sql_extra $sql_extra2 ", + where abook_channel = %d and not (abook_flags & %d)>0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ", intval(local_user()), - intval(ABOOK_FLAG_SELF), - intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN) + intval(ABOOK_FLAG_SELF) ); if($r) { $a->set_pager_total($r[0]['total']); @@ -354,10 +352,9 @@ function connections_content(&$a) { } $r = q("SELECT abook.*, xchan.* FROM abook left join xchan on abook.abook_xchan = xchan.xchan_hash - WHERE abook_channel = %d and not (abook_flags & %d)>0 and not ( xchan_flags & %d)>0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ", + WHERE abook_channel = %d and not (abook_flags & %d)>0 and xchan_deleted = 0 and xchan_orphan = 0 $sql_extra $sql_extra2 ORDER BY xchan_name LIMIT %d OFFSET %d ", intval(local_user()), intval(ABOOK_FLAG_SELF), - intval(XCHAN_FLAGS_DELETED|XCHAN_FLAGS_ORPHAN), intval($a->pager['itemspage']), intval($a->pager['start']) ); -- cgit v1.2.3