X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-transfer.php;h=5c2d6651368ebf10b90b68965459407f1660b082;hb=250db0642633941d0c36cef0dc32a1c59e156c65;hp=6ea7326cd24f013a3dcd3694dd6ff45fe0492cb1;hpb=35c959a5ae22c4acde7248367ff4af496aac0415;p=mailer.git diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 6ea7326cd2..5c2d665136 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -40,7 +40,7 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Version number setThisExtensionVersion('0.2.9'); @@ -51,35 +51,35 @@ setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0 switch (getExtensionMode()) { case 'register': // Do stuff when installation is running // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`'); // Transfer from a member addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_in` ( -id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -from_userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -reason VARCHAR(255) NOT NULL DEFAULT '', -time_trans VARCHAR(14) NOT NULL DEFAULT 0, -trans_id VARCHAR(12) NOT NULL DEFAULT '', -KEY (userid), -KEY (from_userid), -PRIMARY KEY (id) +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`from_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`reason` VARCHAR(255) NOT NULL DEFAULT '', +`time_trans` VARCHAR(14) NOT NULL DEFAULT 0, +`trans_id` VARCHAR(12) NOT NULL DEFAULT '', +KEY (`userid`), +KEY (`from_userid`), +PRIMARY KEY (`id`) ) Type={?_TABLE_TYPE?}"); // Transfers to a member addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_out` ( -id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -to_userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -reason VARCHAR(255) NOT NULL DEFAULT '', -time_trans VARCHAR(14) NOT NULL DEFAULT 0, -trans_id VARCHAR(12) NOT NULL DEFAULT '', -KEY (userid), -KEY (to_userid), -PRIMARY KEY (id) +`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, +`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`to_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, +`reason` VARCHAR(255) NOT NULL DEFAULT '', +`time_trans` VARCHAR(14) NOT NULL DEFAULT 0, +`trans_id` VARCHAR(12) NOT NULL DEFAULT '', +KEY (`userid`), +KEY (`to_userid`), +PRIMARY KEY (`id`) ) Type={?_TABLE_TYPE?}"); // Admin menu @@ -92,11 +92,11 @@ PRIMARY KEY (id) addMemberMenuSql('main','transfer','{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Transfer','N','Y', 5); // Add config values - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*28)."'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('ONE_DAY')."'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 50"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_age` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*28)); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_balance` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_code` BIGINT(20) UNSIGNED NOT NULL DEFAULT 5"); // Add row(s) to user's data addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'"); @@ -104,8 +104,8 @@ PRIMARY KEY (id) case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`"); - addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`"); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`'); + addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='transfer'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='transfer'"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `opt_in`"); @@ -125,7 +125,7 @@ PRIMARY KEY (id) switch (getCurrentExtensionVersion()) { case '0.0.2': // SQL queries for v0.0.2 // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Fehler