From a6f6f92a24278dd6c449332e593f91eed0861640 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sat, 24 Feb 2018 10:45:54 -0500 Subject: [PATCH] Rename plugin to addon --- dfrndir.sql | 4 ++-- include/site-health.php | 4 ++-- mod/health.php | 2 +- mod/servers.php | 34 +++++++++++++++++----------------- mod/siteinfo.php | 15 +++++++-------- mod/updatesites.php | 6 +++--- 6 files changed, 32 insertions(+), 33 deletions(-) diff --git a/dfrndir.sql b/dfrndir.sql index 29cff504..f7fe0f94 100644 --- a/dfrndir.sql +++ b/dfrndir.sql @@ -81,7 +81,7 @@ CREATE TABLE IF NOT EXISTS `site` ( `name` char(255) NOT NULL, `url` char(255) NOT NULL, `version` char(16) NOT NULL, - `plugins` text NOT NULL, + `addons` text NOT NULL, `reg_policy` char(32) NOT NULL, `info` text NOT NULL, `admin_name` char(255) NOT NULL, @@ -107,7 +107,7 @@ CREATE TABLE IF NOT EXISTS `site-health` ( `dt_last_heartbeat` datetime DEFAULT NULL, `name` varchar(255) DEFAULT NULL, `version` varchar(255) DEFAULT NULL, - `plugins` text, + `addons` text, `reg_policy` char(32) DEFAULT NULL, `info` text, `admin_name` varchar(255) DEFAULT NULL, diff --git a/include/site-health.php b/include/site-health.php index 0acfd14f..067524a6 100644 --- a/include/site-health.php +++ b/include/site-health.php @@ -213,7 +213,7 @@ if (!function_exists('run_site_probe')) { "`dt_last_seen` = NOW(), `name` = '%s', `version` = '%s', - `plugins` = '%s', + `addons` = '%s', `reg_policy` = '%s', `info` = '%s', `admin_name` = '%s', @@ -221,7 +221,7 @@ if (!function_exists('run_site_probe')) { ", dbesc($data->site_name), dbesc($data->version), - dbesc(implode("\r\n", $data->plugins)), + dbesc(implode("\r\n", $data->addons)), dbesc($data->register_policy), dbesc($data->info), dbesc($data->admin->name), diff --git a/mod/health.php b/mod/health.php index 0a92fe4b..777faff7 100644 --- a/mod/health.php +++ b/mod/health.php @@ -382,7 +382,7 @@ function health_details(App $a, $id) '$dt_first_noticed' => $site['dt_first_noticed'], '$dt_last_seen' => $site['dt_last_seen'], '$version' => $site['version'], - '$plugins' => $site['plugins'], + '$addons' => $site['addons'], '$reg_policy' => $site['reg_policy'], '$info' => $site['info'], '$admin_name' => $site['admin_name'], diff --git a/mod/servers.php b/mod/servers.php index 15f4da89..3a7866fe 100644 --- a/mod/servers.php +++ b/mod/servers.php @@ -58,28 +58,28 @@ function servers_content(&$a) { $site['users'] = $users; //Figure out what this server supports. - $plugins = explode("\r\n", $site['plugins']); - $site['plugins'] = $plugins; - $hasPlugin = function (array $input) use ($plugins) { - return !!count(array_intersect($input, $plugins)); + $addons = explode("\r\n", $site['addons']); + $site['addons'] = $addons; + $hasAddon = function (array $input) use ($addons) { + return !!count(array_intersect($input, $addons)); }; $site['supports'] = array( 'HTTPS' => $site['ssl_state'] == 1, - 'Twitter' => $hasPlugin(array('buffer', 'twitter')), - 'Facebook' => $hasPlugin(array('buffer')), - 'Google+' => $hasPlugin(array('buffer', 'gpluspost')), + 'Twitter' => $hasAddon(array('buffer', 'twitter')), + 'Facebook' => $hasAddon(array('buffer')), + 'Google+' => $hasAddon(array('buffer', 'gpluspost')), 'RSS/Atom' => true, //Built-in. - 'Diaspora*' => $hasPlugin(array('diaspora')), - 'pump.io' => $hasPlugin(array('pumpio')), - 'StatusNet' => $hasPlugin(array('statusnet')), - 'Tumblr' => $hasPlugin(array('tumblr')), - 'Blogger' => $hasPlugin(array('blogger')), - 'Dreamwidth' => $hasPlugin(array('dwpost')), - 'Wordpress' => $hasPlugin(array('wppost')), - 'LiveJournal' => $hasPlugin(array('ljpost')), - 'Insanejournal' => $hasPlugin(array('ijpost')), - 'Libertree' => $hasPlugin(array('libertree')) + 'Diaspora*' => $hasAddon(array('diaspora')), + 'pump.io' => $hasAddon(array('pumpio')), + 'StatusNet' => $hasAddon(array('statusnet')), + 'Tumblr' => $hasAddon(array('tumblr')), + 'Blogger' => $hasAddon(array('blogger')), + 'Dreamwidth' => $hasAddon(array('dwpost')), + 'Wordpress' => $hasAddon(array('wppost')), + 'LiveJournal' => $hasAddon(array('ljpost')), + 'Insanejournal' => $hasAddon(array('ijpost')), + 'Libertree' => $hasAddon(array('libertree')) ); //Subset of the full support list, to show popular items. diff --git a/mod/siteinfo.php b/mod/siteinfo.php index b6085b9e..8b1629fa 100644 --- a/mod/siteinfo.php +++ b/mod/siteinfo.php @@ -5,7 +5,7 @@ site_name version url -plugins (arr) +addons (arr) register_policy admin: name @@ -26,7 +26,7 @@ function siteinfo_content(&$a) { $o .= '

Friendica is experiencing very rapid growth and we need more public portals - as some of our primary servers are reaching capacity. Friendica is a decentralised and distributed network. Help us share the load. If you can provide a Friendica server for public use, please send the URL to info at friendica dot com. We will include you in our list.

'; - $r = q("select * from site where url != '' and version != '' and not plugins like '%%testdrive%%' order by rand()"); + $r = q("select * from site where url != '' and version != '' and not addons like '%%testdrive%%' order by rand()"); $policy = array ( 'REGISTER_CLOSED' => 'closed', 'REGISTER_OPEN' => 'open', 'REGISTER_APPROVE' => 'requires approval'); @@ -40,7 +40,7 @@ function siteinfo_content(&$a) { $o .= '' . t('Registration') . ''; $o .= '' . t('Additional Info') . ''; $o .= '' . t('Version') . ''; - $o .= '' . t('Plugins Installed') . ''; + $o .= '' . t('Addons Installed') . ''; $o .= '' . t('Site Administrator') . ''; $o .= '' . t('Record Updated (UTC)') . ''; $o .= ''; @@ -53,14 +53,14 @@ function siteinfo_content(&$a) { $o .= '' . $policy[$rr['reg_policy']] . ''; $o .= '' . $rr['info'] . ''; $o .= '' . $rr['version'] . ''; - $o .= '' . str_replace(',',', ',$rr['plugins']) . ''; + $o .= '' . str_replace(',',', ',$rr['addons']) . ''; $o .= '' . '' . $rr['admin_name'] . '' . ''; $o .= '' . $rr['updated'] . ''; $o .= ''; } } - $r = q("select * from site where url != '' and version != '' and plugins like '%%testdrive%%' order by rand()"); + $r = q("select * from site where url != '' and version != '' and addons like '%%testdrive%%' order by rand()"); if(count($r)) { $o .= '-- Demo and test sites -- Limited account duration with expiration --'; @@ -72,7 +72,7 @@ function siteinfo_content(&$a) { $o .= '' . $policy[$rr['reg_policy']] . ''; $o .= '' . $rr['info'] . ''; $o .= '' . $rr['version'] . ''; - $o .= '' . str_replace(',',', ',$rr['plugins']) . ''; + $o .= '' . str_replace(',',', ',$rr['addons']) . ''; $o .= '' . '' . $rr['admin_name'] . '' . ''; $o .= '' . $rr['updated'] . ''; $o .= ''; @@ -94,5 +94,4 @@ function siteinfo_content(&$a) { return $o; -} - \ No newline at end of file +} diff --git a/mod/updatesites.php b/mod/updatesites.php index aeeefa7f..aacd290e 100644 --- a/mod/updatesites.php +++ b/mod/updatesites.php @@ -16,7 +16,7 @@ function updatesites_content(&$a) { else continue; if($j) { - $plugs = (array) $j->plugins; + $plugs = (array) $j->addons; if(in_array('testdrive',$plugs)) { $j->site_name = '!!! Test/Demo ONLY. !!! ' . $j->site_name; $j->info = 'Accounts are temporary, expiration is enabled. ' . $j->info; @@ -25,9 +25,9 @@ function updatesites_content(&$a) { q("UPDATE site set name = '%s', - url = '%s', + url = '%s', version = '%s', - plugins = '%s', + addons = '%s', reg_policy = '%s', info = '%s', admin_name = '%s',