5 function ping_init(&$a) {
10 $r = q("SELECT COUNT(*) AS `total` FROM `item`
11 WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
14 $network = $r[0]['total'];
16 $r = q("SELECT COUNT(*) AS `total` FROM `item`
17 WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `wall` = 1 ",
20 $home = $r[0]['total'];
22 $r = q("SELECT COUNT(*) AS `total` FROM `intro`
23 WHERE `uid` = %d AND `blocked` = 0 AND `ignore` = 0 ",
26 $intro = $r[0]['total'];
28 if ($a->config['register_policy'] == REGISTER_APPROVE &&
29 $a->config['admin_email'] === $a->user['email']){
30 $r = q("SELECT COUNT(*) AS `total` FROM `register`");
31 $register = $r[0]['total'];
37 $myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
38 $r = q("SELECT COUNT(*) AS `total` FROM `mail`
39 WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
44 $mail = $r[0]['total'];
46 header("Content-type: text/xml");
47 echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<result><register>$register</register><intro>$intro</intro><mail>$mail</mail><net>$network</net><home>$home</home></result>\r\n";