X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fping.php;h=cb067f3feb04fcd55843ed857badc7062c6427c7;hb=8c245a5d2f4e6882211ac17561f86537a7089c73;hp=7e96b712175a7999c97a790bd2402b85d403b541;hpb=8f7e81a8b31aa8d734d9fe014ecdb7d2a13301d2;p=friendica.git
diff --git a/mod/ping.php b/mod/ping.php
index 7e96b71217..cb067f3feb 100644
--- a/mod/ping.php
+++ b/mod/ping.php
@@ -9,33 +9,42 @@ function ping_init(&$a) {
$r = q("SELECT COUNT(*) AS `total` FROM `item`
WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
- intval($_SESSION['uid'])
+ intval(local_user())
);
$network = $r[0]['total'];
$r = q("SELECT COUNT(*) AS `total` FROM `item`
WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `type` != 'remote' ",
- intval($_SESSION['uid'])
+ 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();
}