From 7e6febe2a6609457eca1f1caf650375534780048 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 24 Feb 2016 15:19:28 -0800 Subject: add 'requires' field to plugin info to list other dependent plugins/addons and disable if dependencies are not installed/enabled --- include/plugin.php | 19 ++++++++++++++++++- mod/admin.php | 2 +- mod/xrd.php | 4 +--- view/tpl/admin_plugins_details.tpl | 3 +++ 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/include/plugin.php b/include/plugin.php index 5afded542..bd844442f 100755 --- a/include/plugin.php +++ b/include/plugin.php @@ -325,7 +325,8 @@ function get_plugin_info($plugin){ 'description' => '', 'author' => array(), 'maintainer' => array(), - 'version' => '' + 'version' => '', + 'requires' => '' ); if (!is_file("addon/$plugin/$plugin.php")) @@ -383,6 +384,22 @@ function check_plugin_versions($info) { } } + if(array_key_exists('requires',$info)) { + $arr = explode(',',$info['requires']); + $found = true; + if($arr) { + foreach($arr as $test) { + $test = trim($test); + if(! $test) + continue; + if(! in_array($test,get_app()->plugins)) + $found = false; + } + } + if(! $found) + return false; + } + return true; } diff --git a/mod/admin.php b/mod/admin.php index 5195db320..292a4e66a 100644 --- a/mod/admin.php +++ b/mod/admin.php @@ -1275,7 +1275,7 @@ function admin_page_plugins(&$a){ '$str_minversion' => t('Minimum project version: '), '$str_maxversion' => t('Maximum project version: '), '$str_minphpversion' => t('Minimum PHP version: '), - + '$str_requires' => t('Requires: '), '$disabled' => t('Disabled - version incompatibility'), '$admin_form' => $admin_form, diff --git a/mod/xrd.php b/mod/xrd.php index 34ed47149..da4ab51a4 100644 --- a/mod/xrd.php +++ b/mod/xrd.php @@ -35,8 +35,6 @@ function xrd_init(&$a) { header("Content-type: application/xrd+xml"); - $tpl = get_markup_template('view/xrd_person.tpl'); - $o = replace_macros(get_markup_template('xrd_person.tpl'), array( '$nick' => $r[0]['channel_address'], '$accturi' => $uri, @@ -51,7 +49,7 @@ function xrd_init(&$a) { // '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'] . '/mention', '$modexp' => 'data:application/magic-public-key,' . $salmon_key, '$subscribe' => $a->get_baseurl() . '/follow?url={uri}', -// '$bigkey' => salmon_key($r[0]['pubkey']) + '$bigkey' => salmon_key($r[0]['channel_pubkey']) )); diff --git a/view/tpl/admin_plugins_details.tpl b/view/tpl/admin_plugins_details.tpl index 721bd3573..5d9e233f9 100755 --- a/view/tpl/admin_plugins_details.tpl +++ b/view/tpl/admin_plugins_details.tpl @@ -24,6 +24,9 @@ {{if $info.minphpversion}}

{{$str_minphpversion}}{{$info.minphpversion}}

{{/if}} + {{if $info.requires}} +

{{$str_requires}}{{$info.requires}}

+ {{/if}} {{foreach $info.maintainer as $a}} -- cgit v1.2.3 From 6300f47cdcd921141b8f98b71d373d53aa3d80f2 Mon Sep 17 00:00:00 2001 From: redmatrix Date: Wed, 24 Feb 2016 16:59:50 -0800 Subject: schema change to support channel move (a completely different operation than channel clone) --- boot.php | 2 +- install/schema_mysql.sql | 4 +++- install/schema_postgres.sql | 2 ++ install/update.php | 17 ++++++++++++++++- view/en-au/update_fail_eml.tpl | 2 +- 5 files changed, 23 insertions(+), 4 deletions(-) diff --git a/boot.php b/boot.php index f1c7d8951..7610f16d8 100755 --- a/boot.php +++ b/boot.php @@ -50,7 +50,7 @@ define ( 'RED_VERSION', trim(file_get_contents('version.inc'))); define ( 'STD_VERSION', '1.2.4' ); define ( 'ZOT_REVISION', 1 ); -define ( 'DB_UPDATE_VERSION', 1163 ); +define ( 'DB_UPDATE_VERSION', 1164 ); /** diff --git a/install/schema_mysql.sql b/install/schema_mysql.sql index 161c174e5..07a88cf0a 100644 --- a/install/schema_mysql.sql +++ b/install/schema_mysql.sql @@ -230,6 +230,7 @@ CREATE TABLE IF NOT EXISTS `channel` ( `channel_w_like` int(10) unsigned NOT NULL DEFAULT '0', `channel_removed` tinyint(1) NOT NULL DEFAULT '0', `channel_system` tinyint(1) NOT NULL DEFAULT '0', + `channel_moved` char(255) NOT NULL DEFAULT '', PRIMARY KEY (`channel_id`), UNIQUE KEY `channel_address_unique` (`channel_address`), KEY `channel_account_id` (`channel_account_id`), @@ -268,7 +269,8 @@ CREATE TABLE IF NOT EXISTS `channel` ( KEY `channel_w_like` (`channel_w_like`), KEY `channel_removed` (`channel_removed`), KEY `channel_system` (`channel_system`), - KEY `channel_lastpost` (`channel_lastpost`) + KEY `channel_lastpost` (`channel_lastpost`), + KEY `channel_moved` (`channel_moved`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; CREATE TABLE IF NOT EXISTS `chat` ( diff --git a/install/schema_postgres.sql b/install/schema_postgres.sql index 964ca5966..3302ef6c0 100644 --- a/install/schema_postgres.sql +++ b/install/schema_postgres.sql @@ -225,6 +225,7 @@ CREATE TABLE "channel" ( "channel_w_like" bigint NOT NULL DEFAULT '128', "channel_removed" smallint NOT NULL DEFAULT '0', "channel_system" smallint NOT NULL DEFAULT '0', + "channel_moved" text NOT NULL DEFAULT '', PRIMARY KEY ("channel_id"), UNIQUE ("channel_address") ); @@ -265,6 +266,7 @@ create index "channel_dirdate" on channel ("channel_dirdate"); create index "channel_lastpost" on channel ("channel_lastpost"); create index "channel_removed" on channel ("channel_removed"); create index "channel_system" on channel ("channel_system"); +create index "channel_moved" on channel ("channel_moved"); CREATE TABLE "chat" ( "chat_id" serial NOT NULL, "chat_room" bigint NOT NULL DEFAULT '0', diff --git a/install/update.php b/install/update.php index d21295be7..0f9b3ab28 100644 --- a/install/update.php +++ b/install/update.php @@ -1,6 +1,6 @@