From cee9a20e85219c8628b853b57d0c366b31f3c0e0 Mon Sep 17 00:00:00 2001 From: zotlabs Date: Thu, 2 Mar 2017 18:10:23 -0800 Subject: activity widget - turns out the owner is not relevant. --- include/widgets.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/include/widgets.php b/include/widgets.php index a659101b9..f05c7c0ee 100644 --- a/include/widgets.php +++ b/include/widgets.php @@ -1508,7 +1508,7 @@ function widget_activity($arr) { $perms_sql = item_permissions_sql(local_channel()) . item_normal(); - $r = q("select owner_xchan, author_xchan from item where item_unseen = 1 and uid = %d $perms_sql", + $r = q("select author_xchan from item where item_unseen = 1 and uid = %d $perms_sql", intval(local_channel()) ); @@ -1517,16 +1517,12 @@ function widget_activity($arr) { if($r) { foreach($r as $rv) { - if(array_key_exists($rv['owner_xchan'],$contributors)) - $contributors[$rv['owner_xchan']] ++; - else - $contributors[$rv['owner_xchan']] = 1; - if($rv['owner_xchan'] === $rv['author_xchan']) - continue; - if(array_key_exists($rv['author_xchan'],$contributors)) + if(array_key_exists($rv['author_xchan'],$contributors)) { $contributors[$rv['author_xchan']] ++; - else + } + else { $contributors[$rv['author_xchan']] = 1; + } } foreach($contributors as $k => $v) { $arr[] = [ 'author_xchan' => $k, 'total' => $v ]; -- cgit v1.2.3