aboutsummaryrefslogtreecommitdiffstats
path: root/mod/ping.php
diff options
context:
space:
mode:
Diffstat (limited to 'mod/ping.php')
-rw-r--r--mod/ping.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/mod/ping.php b/mod/ping.php
index bc160ade7..ea5c308a3 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -25,9 +25,15 @@ function ping_init(&$a) {
);
$intro = $r[0]['total'];
- // TODO
- $mail = 0;
+ $myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
+ $r = q("SELECT COUNT(*) AS `total` FROM `mail`
+ WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
+ intval($_SESSION['uid']),
+ dbesc($myurl)
+ );
+ $mail = $r[0]['total'];
+
header("Content-type: text/xml");
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";