From 5a3fb6dd23e399cb2892346f0e7be0cc6d2bd2ca Mon Sep 17 00:00:00 2001 From: natter Date: Sat, 2 Jun 2018 18:33:19 +0200 Subject: [PATCH] v1.2.1: added check if ts3_sgid exist before alter table --- inc/plugins/teamspeak3.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/inc/plugins/teamspeak3.php b/inc/plugins/teamspeak3.php index 9a41f40..c06837c 100644 --- a/inc/plugins/teamspeak3.php +++ b/inc/plugins/teamspeak3.php @@ -33,7 +33,7 @@ function teamspeak3_info() 'website'=>'https://github.com/TerranUlm/MyBB-Plugin-Teamspeak3-Sync', 'author'=>'Dieter Gobbers (@Terran_ulm)', 'authorsite' => 'https://opt-community.de/', - 'version'=>'1.2.0', + 'version'=>'1.2.1', 'codename'=>'opt_teamspeak', 'compatibility'=>'18*' ); @@ -105,7 +105,9 @@ function teamspeak3_install() ); $db->insert_query('settinggroups',$setting_group_array); $group=$db->insert_id(); - $db->query("ALTER TABLE `".TABLE_PREFIX."usergroups` ADD `ts3_sgid` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Servergroiup ID', ADD `ts3_cgid` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Channelgroup ID', ADD `ts3_cid` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Channel ID', ADD `ts3_order` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Sort Order/Sequence'"); + if(! $db->field_exists('ts3_sgid', "usergroups")){ + $db->query("ALTER TABLE `".TABLE_PREFIX."usergroups` ADD `ts3_sgid` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Servergroiup ID', ADD `ts3_cgid` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Channelgroup ID', ADD `ts3_cid` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Channel ID', ADD `ts3_order` INT UNSIGNED NULL DEFAULT NULL COMMENT 'Sort Order/Sequence'"); + } $settings=array ( 'teamspeak3_framework_path'=>array