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 AND `wall` = 0 ",
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) && (is_site_admin())) {
29 $r = q("SELECT COUNT(*) AS `total` FROM `register`");
30 $register = $r[0]['total'];
36 $myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
37 $r = q("SELECT COUNT(*) AS `total` FROM `mail`
38 WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
43 $mail = $r[0]['total'];
45 header("Content-type: text/xml");
46 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";