]> git.mxchange.org Git - friendica.git/blobdiff - mod/ping.php
wrong record
[friendica.git] / mod / ping.php
index 0831e57bfa723bca2e84e09f6bb593feae110c6e..924f9ff76bff228c0db16ff41e91c34d2c59d25c 100644 (file)
@@ -8,13 +8,13 @@ function ping_init(&$a) {
                xml_status(0);
 
        $r = q("SELECT COUNT(*) AS `total` FROM `item` 
-               WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d",
+               WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `wall` = 0 ",
                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' ",
+               WHERE `unseen` = 1 AND `visible` = 1 AND `deleted` = 0 AND `uid` = %d AND `wall` = 1 ",
                intval(local_user())
        );
        $home = $r[0]['total'];
@@ -31,11 +31,18 @@ function ping_init(&$a) {
                intval(local_user()),
                dbesc($myurl)
        );
-
        $mail = $r[0]['total'];
+
+       if ($a->config['register_policy'] == REGISTER_APPROVE && is_site_admin()){
+               $r = q("SELECT COUNT(*) AS `total` FROM `register`");
+               $register = $r[0]['total'];
+       } else {
+               $register = "0";
+       }
+
        
        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";
+       echo "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\r\n<result><intro>$intro</intro><mail>$mail</mail><net>$network</net><home>$home</home><register>$register</register></result>\r\n";
 
        killme();
 }