From: Hypolite Petovan Date: Wed, 23 Nov 2016 02:14:25 +0000 (-0500) Subject: Merge remote-tracking branch 'friendica/develop' into improvement/ping-php-json X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=133120007c4f7c12f32e096898889841c53e25b4;p=friendica.git Merge remote-tracking branch 'friendica/develop' into improvement/ping-php-json --- 133120007c4f7c12f32e096898889841c53e25b4 diff --cc mod/ping.php index 7ef2231080,6f612303fb..0929f02599 --- a/mod/ping.php +++ b/mod/ping.php @@@ -123,15 -65,16 +123,15 @@@ function ping_init(App $a intval(local_user()), intval(local_user()) ); - if (dbm::is_result($r)) { - - $arr = array('items' => $r); + if (dbm::is_result($items_unseen)) { + $arr = array('items' => $items_unseen); call_hooks('network_ping', $arr); - foreach ($r as $it) { - if ($it['wall']) { + foreach ($items_unseen as $item) { + if ($item['wall']) { $home_count++; } else { - $network++; + $network_count++; } } } @@@ -186,17 -129,20 +186,15 @@@ $mail_count = count($mails); if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){ - $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) as `total` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1"); + $regs = q("SELECT `contact`.`name`, `contact`.`url`, `contact`.`micro`, `register`.`created`, COUNT(*) AS `total` + FROM `contact` RIGHT JOIN `register` ON `register`.`uid` = `contact`.`uid` + WHERE `contact`.`self` = 1"); if ($regs) { - $register = $regs[0]['total']; + $register_count = $regs[0]['total']; } - } else { - $register = 0; } - $all_events = 0; - $all_events_today = 0; - $events = 0; - $events_today = 0; - $birthdays = 0; - $birthdays_today = 0; - - $ev = q("SELECT count(`event`.`id`) as total, type, start, adjust FROM `event` + $ev = q("SELECT count(`event`.`id`) AS total, type, start, adjust FROM `event` WHERE `event`.`uid` = %d AND `start` < '%s' AND `finish` > '%s' and `ignore` = 0 ORDER BY `start` ASC ", intval(local_user()), @@@ -229,11 -175,12 +227,11 @@@ } } - $data = array(); $data['intro'] = $intro_count; $data['mail'] = $mail_count; - $data['net'] = $network; - $data['home'] = $home; - $data['register'] = $register; + $data['net'] = $network_count; + $data['home'] = $home_count; + $data['register'] = $register_count; $data['all-events'] = $all_events; $data['all-events-today'] = $all_events_today;