From 5547bc2cc254d27c78bcdd15123a024b52e0a99b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Thu, 22 Dec 2016 17:03:00 +0100 Subject: [PATCH] Continued rewriting a bit: - more usage of dbm::is_result() - nicer look of code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- include/items.php | 4 +--- mod/allfriends.php | 30 +++++++++++++++--------------- 2 files changed, 16 insertions(+), 18 deletions(-) diff --git a/include/items.php b/include/items.php index 327096341c..8d95c35529 100644 --- a/include/items.php +++ b/include/items.php @@ -1260,7 +1260,7 @@ function tag_deliver($uid,$item_id) { $c = q("select name, url, thumb from contact where self = 1 and uid = %d limit 1", intval($u[0]['uid']) ); - if (! count($c)) { + if (! dbm::is_result($c)) { return; } @@ -1293,8 +1293,6 @@ function tag_deliver($uid,$item_id) { function tgroup_check($uid,$item) { - $a = get_app(); - $mention = false; // check that the message originated elsewhere and is a top-level post diff --git a/mod/allfriends.php b/mod/allfriends.php index 9e14a67d2e..7a134a7be1 100644 --- a/mod/allfriends.php +++ b/mod/allfriends.php @@ -28,7 +28,7 @@ function allfriends_content(App &$a) { intval(local_user()) ); - if (! count($c)) { + if (! dbm::is_result($c)) { return; } @@ -71,20 +71,20 @@ function allfriends_content(App &$a) { } $entry = array( - 'url' => $rr['url'], - 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']), - 'name' => htmlentities($contact_details['name']), - 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB), - 'img_hover' => htmlentities($contact_details['name']), - 'details' => $contact_details['location'], - 'tags' => $contact_details['keywords'], - 'about' => $contact_details['about'], - 'account_type' => account_type($contact_details), - 'network' => network_to_name($contact_details['network'], $contact_details['url']), - 'photo_menu' => $photo_menu, - 'conntxt' => t('Connect'), - 'connlnk' => $connlnk, - 'id' => ++$id, + 'url' => $rr['url'], + 'itemurl' => (($contact_details['addr'] != "") ? $contact_details['addr'] : $rr['url']), + 'name' => htmlentities($contact_details['name']), + 'thumb' => proxy_url($contact_details['thumb'], false, PROXY_SIZE_THUMB), + 'img_hover' => htmlentities($contact_details['name']), + 'details' => $contact_details['location'], + 'tags' => $contact_details['keywords'], + 'about' => $contact_details['about'], + 'account_type' => account_type($contact_details), + 'network' => network_to_name($contact_details['network'], $contact_details['url']), + 'photo_menu' => $photo_menu, + 'conntxt' => t('Connect'), + 'connlnk' => $connlnk, + 'id' => ++$id, ); $entries[] = $entry; }