5 function ping_init(&$a) {
10 $r = q("SELECT COUNT(*) AS `total` FROM `item`
11 WHERE `unseen` = 1 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 `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'];
31 header("Content-type: text/xml");
32 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";