]> git.mxchange.org Git - friendica.git/commitdiff
Merge remote-tracking branch 'friendica/develop' into improvement/ping-php-json
authorHypolite Petovan <ben.lort@gmail.com>
Wed, 23 Nov 2016 02:14:25 +0000 (21:14 -0500)
committerHypolite Petovan <ben.lort@gmail.com>
Wed, 23 Nov 2016 02:14:25 +0000 (21:14 -0500)
1  2 
mod/ping.php

diff --cc mod/ping.php
index 7ef2231080f1bc5ea35c4b1f7b80039f17253bec,6f612303fb0ba9cceed3c26875af867106437790..0929f02599310ee7c877f9f8caba531a8258daa8
@@@ -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++;
                                }
                        }
                }
                $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()),
                        }
                }
  
 -              $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;