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",
12 intval($_SESSION['uid'])
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 `type` != 'remote' ",
18 intval($_SESSION['uid'])
20 $home = $r[0]['total'];
22 $r = q("SELECT COUNT(*) AS `total` FROM `intro`
23 WHERE `uid` = %d AND `blocked` = 0 AND `ignore` = 0 ",
24 intval($_SESSION['uid'])
26 $intro = $r[0]['total'];
28 $myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
29 $r = q("SELECT COUNT(*) AS `total` FROM `mail`
30 WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
31 intval($_SESSION['uid']),
35 $mail = $r[0]['total'];
37 header("Content-type: text/xml");
38 echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<result><intro>$intro</intro><mail>$mail</mail><net>$network</net><home>$home</home></result>\r\n";