statistics.json: it now contains the connectors as well.
parent
fff767089e
commit
30ee2ab542
|
@ -18,6 +18,11 @@ function statistics_json_uninstall() {
|
||||||
|
|
||||||
function statistics_json_module() {}
|
function statistics_json_module() {}
|
||||||
|
|
||||||
|
function statistics_json_plugin_enabled($plugin) {
|
||||||
|
$r = q("SELECT * FROM `addon` WHERE `installed` = 1 AND `name` = '%s'", $plugin);
|
||||||
|
return((bool)(count($r) > 0));
|
||||||
|
}
|
||||||
|
|
||||||
function statistics_json_init() {
|
function statistics_json_init() {
|
||||||
global $a;
|
global $a;
|
||||||
|
|
||||||
|
@ -32,6 +37,18 @@ function statistics_json_init() {
|
||||||
"local_posts" => get_config('statistics_json','local_posts')
|
"local_posts" => get_config('statistics_json','local_posts')
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$statistics["facebook"] = statistics_json_plugin_enabled("fbpost");
|
||||||
|
$statistics["twitter"] = statistics_json_plugin_enabled("twitter");
|
||||||
|
$statistics["tumblr"] = statistics_json_plugin_enabled("tumblr");
|
||||||
|
$statistics["wordpress"] = statistics_json_plugin_enabled("wppost");
|
||||||
|
$statistics["appnet"] = statistics_json_plugin_enabled("appnet");
|
||||||
|
$statistics["blogger"] = statistics_json_plugin_enabled("blogger");
|
||||||
|
$statistics["buffer"] = statistics_json_plugin_enabled("buffer");
|
||||||
|
$statistics["googleplus"] = statistics_json_plugin_enabled("gpluspost");
|
||||||
|
$statistics["libertree"] = statistics_json_plugin_enabled("libertree");
|
||||||
|
$statistics["pumpio"] = statistics_json_plugin_enabled("pumpio");
|
||||||
|
$statistics["gnusocial"] = statistics_json_plugin_enabled("statusnet");
|
||||||
|
|
||||||
header("Content-Type: application/json");
|
header("Content-Type: application/json");
|
||||||
echo json_encode($statistics);
|
echo json_encode($statistics);
|
||||||
logger("statistics_init: printed ".print_r($statistics, true));
|
logger("statistics_init: printed ".print_r($statistics, true));
|
||||||
|
|
Loading…
Reference in New Issue