intval(local_user())
);
- $intro = count($intros1) + count($intros2);
- $intros = $intros1+$intros2;
+ $intro_count = count($intros1) + count($intros2);
- $intros = $intros1+$intros2;
++ $intros = $intros1 + $intros2;
$myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
- $mails = q("SELECT * FROM `mail`
+ $mails = qu("SELECT `id`, `from-name`, `from-url`, `from-photo`, `created` FROM `mail`
WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
intval(local_user()),
dbesc($myurl)
);
- $mail = count($mails);
+ $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` FROM `contact` RIGHT JOIN `register` ON `register`.`uid`=`contact`.`uid` WHERE `contact`.`self`=1");
- $register = count($regs);
- } else {
- $register = 0;
- }
+ $regs = qu("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) {
+
- $all_events = 0;
- $all_events_today = 0;
- $events = 0;
- $events_today = 0;
- $birthdays = 0;
- $birthdays_today = 0;
++ $register_count = 0;
+
++ if (dbm::is_result($regs)) {
+ $register_count = $regs[0]['total'];
+ }
+ }
- $ev = q("SELECT count(`event`.`id`) as total, type, start, adjust FROM `event`
+ $ev = qu("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()),