X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=mod%2Fping.php;h=cb067f3feb04fcd55843ed857badc7062c6427c7;hb=3ad7c395fb9a33319531e04673563e7c9983d8f0;hp=ea5c308a30b64929fcadf4200abac0029e5c6337;hpb=56fc81f57e07f4208c639fee71105b66471846ef;p=friendica.git
diff --git a/mod/ping.php b/mod/ping.php
index ea5c308a30..cb067f3feb 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -8,34 +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'];
- $myurl = $a->get_baseurl() . '/profile/' . $user['nickname'] ;
+ 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($_SESSION['uid']),
+ 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();
}