X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=mod%2Fnodeinfo.php;h=104fecb755ddc21ea1ad118ffaaeecc84b603700;hb=c99247ddabe7e8383aa86f94d4ffae73e382a710;hp=334dcb055d6c3868c43016e6c864d60ef3ce2222;hpb=fc3c1601b1d8de58aff2457f6e116ea226c69ced;p=friendica.git diff --git a/mod/nodeinfo.php b/mod/nodeinfo.php index 334dcb055d..104fecb755 100644 --- a/mod/nodeinfo.php +++ b/mod/nodeinfo.php @@ -7,20 +7,20 @@ require_once("include/plugin.php"); -function nodeinfo_wellknown(&$a) { +function nodeinfo_wellknown(App &$a) { if (!get_config("system", "nodeinfo")) { http_status_exit(404); killme(); } $nodeinfo = array("links" => array(array("rel" => "http://nodeinfo.diaspora.software/ns/schema/1.0", - "href" => $a->get_baseurl()."/nodeinfo/1.0"))); + "href" => App::get_baseurl()."/nodeinfo/1.0"))); header('Content-type: application/json; charset=utf-8'); echo json_encode($nodeinfo, JSON_PRETTY_PRINT|JSON_UNESCAPED_SLASHES); exit; } -function nodeinfo_init(&$a){ +function nodeinfo_init(App &$a){ if (!get_config("system", "nodeinfo")) { http_status_exit(404); killme(); @@ -174,7 +174,7 @@ function nodeinfo_cron() { return; $last = get_config('nodeinfo','last_calucation'); -/* + if($last) { // Calculate every 24 hours $next = $last + (24 * 60 * 60); @@ -183,7 +183,7 @@ function nodeinfo_cron() { return; } } -*/ logger("cron_start"); + logger("cron_start"); $users = qu("SELECT `user`.`uid`, `user`.`login_date`, `contact`.`last-item` FROM `user` @@ -217,13 +217,8 @@ function nodeinfo_cron() { set_config('nodeinfo','active_users_monthly', $active_users_monthly); } - $posts = qu("SELECT COUNT(*) AS local_posts FROM `thread` WHERE `thread`.`wall`"); -/* - $posts = qu("SELECT COUNT(*) AS `local_posts` FROM `item` - INNER JOIN `contact` ON `contact`.`id` = `item`.`contact-id` - WHERE `contact`.`self` and `item`.`id` = `item`.`parent` AND left(body, 6) != '[share' AND `item`.`network` IN ('%s', '%s', '%s')", - dbesc(NETWORK_OSTATUS), dbesc(NETWORK_DIASPORA), dbesc(NETWORK_DFRN)); -*/ + $posts = qu("SELECT COUNT(*) AS local_posts FROM `thread` WHERE `thread`.`wall` AND `thread`.`uid` != 0"); + if (!is_array($posts)) $local_posts = -1; else