X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=statistics_json%2Fstatistics_json.php;h=494904ba1401c0f9ab4a4b81efd3448ce23b9c84;hb=3d0a8b45b5b74e9a859094d06e72aaa8e3162785;hp=5bc4902e13e43450f67459fae7264fc238580a17;hpb=c27ee8a3ace0f115e0045a91373ca64a37d07f6f;p=friendica-addons.git diff --git a/statistics_json/statistics_json.php b/statistics_json/statistics_json.php index 5bc4902e..494904ba 100644 --- a/statistics_json/statistics_json.php +++ b/statistics_json/statistics_json.php @@ -23,6 +23,7 @@ function statistics_json_init() { $statistics = array( "name" => $a->config["sitename"], + "network" => FRIENDICA_PLATFORM, "version" => FRIENDICA_VERSION, "registrations_open" => ($a->config['register_policy'] != 0), "total_users" => get_config('statistics_json','total_users'), @@ -41,8 +42,8 @@ function statistics_json_cron($a,$b) { $last = get_config('statistics_json','last_calucation'); if($last) { - // Calculate all 3 hours - $next = $last + (180 * 60); + // Calculate every 24 hours + $next = $last + (24 * 60 * 60); if($next > time()) { logger('statistics_json_cron: calculation intervall not reached'); return; @@ -90,7 +91,7 @@ function statistics_json_cron($a,$b) { set_config('statistics_json','active_users_monthly', $active_users_monthly); } - $posts = q("SELECT COUNT(*) AS local_posts FROM `item` WHERE `wall` AND id=parent"); + $posts = q("SELECT COUNT(*) AS local_posts FROM `item` WHERE `wall` AND left(body, 6) != '[share'"); if (!is_array($posts)) $local_posts = -1; @@ -101,6 +102,12 @@ function statistics_json_cron($a,$b) { logger('statistics_json_cron: local_posts: '.$local_posts, LOGGER_DEBUG); + // Now trying to register + $url = "http://pods.jasonrobinson.me/register/".$a->get_hostname(); + logger('statistics_json_cron: registering url: '.$url, LOGGER_DEBUG); + $ret = fetch_url($url); + logger('statistics_json_cron: registering answer: '.$ret, LOGGER_DEBUG); + logger('statistics_json_cron: cron_end'); set_config('statistics_json','last_calucation', time()); }