X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fping.php;h=cb067f3feb04fcd55843ed857badc7062c6427c7;hb=8c245a5d2f4e6882211ac17561f86537a7089c73;hp=bc160ade7f5abae284534e5892bb247d89f17cbb;hpb=ba8da761e669b22e16e1075e0e1e79d8b458af3e;p=friendica.git
diff --git a/mod/ping.php b/mod/ping.php
index bc160ade7f..cb067f3feb 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -8,28 +8,43 @@ function ping_init(&$a) {
xml_status(0);
$r = q("SELECT COUNT(*) AS `total` FROM `item`
- WHERE `unseen` = 1 AND `uid` = %d",
- intval($_SESSION['uid'])
+ WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
+ intval(local_user())
);
$network = $r[0]['total'];
$r = q("SELECT COUNT(*) AS `total` FROM `item`
- WHERE `unseen` = 1 AND `uid` = %d AND `type` != 'remote' ",
- intval($_SESSION['uid'])
+ WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `type` != 'remote' ",
+ intval(local_user())
);
$home = $r[0]['total'];
$r = q("SELECT COUNT(*) AS `total` FROM `intro`
WHERE `uid` = %d AND `blocked` = 0 AND `ignore` = 0 ",
- intval($_SESSION['uid'])
+ intval(local_user())
);
$intro = $r[0]['total'];
- // TODO
- $mail = 0;
+ if ($a->config['register_policy'] == REGISTER_APPROVE &&
+ $a->config['admin_email'] === $a->user['email']){
+ $r = q("SELECT COUNT(*) AS `total` FROM `register`");
+ $register = $r[0]['total'];
+ } else {
+ $register = "0";
+ }
+
+ $myurl = $a->get_baseurl() . '/profile/' . $a->user['nickname'] ;
+ $r = q("SELECT COUNT(*) AS `total` FROM `mail`
+ WHERE `uid` = %d AND `seen` = 0 AND `from-url` != '%s' ",
+ intval(local_user()),
+ dbesc($myurl)
+ );
+
+ $mail = $r[0]['total'];
+
header("Content-type: text/xml");
- echo "\r\n$intro$mail$network$home\r\n";
+ echo "\r\n$register$intro$mail$network$home\r\n";
killme();
}