From 9ae0f9a65d139df27450bc8350c68d570aad966c Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 2 Feb 2014 21:27:16 +0100 Subject: [PATCH 1/2] statistics: In accordance with Jason from michael.bueker@hamburg-mitte.bezirkspiraten.de the data now contains the network name and all posts (including comments) are counted. --- statistics_json/statistics_json.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/statistics_json/statistics_json.php b/statistics_json/statistics_json.php index 5bc4902e..65d3985d 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'), @@ -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`"); if (!is_array($posts)) $local_posts = -1; From 31cff782f81a08d8264e3388ba0be7df4af77e1b Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 2 Feb 2014 21:45:08 +0100 Subject: [PATCH 2/2] statistics: Don't count shares. --- statistics_json/statistics_json.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statistics_json/statistics_json.php b/statistics_json/statistics_json.php index 65d3985d..ffafb400 100644 --- a/statistics_json/statistics_json.php +++ b/statistics_json/statistics_json.php @@ -91,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`"); + $posts = q("SELECT COUNT(*) AS local_posts FROM `item` WHERE `wall` left(body, 6) != '[share'"); if (!is_array($posts)) $local_posts = -1;