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;