X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-refback.php;h=aca491b1bbc00a3cfd210378bc0f7ae92a10239e;hb=0f40501c47057cd677ddfc5a4d49eb6cf3659306;hp=1c65b0cd5cd04c3ba953420b7fa62eb18ce3b316;hpb=4867976d90c806a03bb0848886f1e175c68cf3a4;p=mailer.git diff --git a/inc/extensions/ext-refback.php b/inc/extensions/ext-refback.php index 1c65b0cd5c..aca491b1bb 100644 --- a/inc/extensions/ext-refback.php +++ b/inc/extensions/ext-refback.php @@ -6,9 +6,9 @@ * -------------------------------------------------------------------- * * File : ext-refback.php * * -------------------------------------------------------------------- * - * Short description : Refback and ref overview * + * Short description : Refback system * * -------------------------------------------------------------------- * - * Kurzbeschreibung : Ref-Back und Ref-Uebersicht * + * Kurzbeschreibung : Refback-System * * -------------------------------------------------------------------- * * $Revision:: $ * * $Date:: $ * @@ -17,7 +17,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -41,39 +41,24 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.0.3'); +setThisExtensionVersion('0.0.4'); // Version history array (add more with , '0.0.1' and so on) -setExtensionVersionHistory(array('0.0.0','0.0.1', '0.0.2', '0.0.3')); +setExtensionVersionHistory(array('0.0.0','0.0.1', '0.0.2', '0.0.3', '0.0.4')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running - // SQL commands to run - addDropTableSql('user_refs'); - addCreateTableSql('user_refs', " -`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, -`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0, -`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, -`refback` float(4,1) NOT NULL DEFAULT 0.0, -`points` FLOAT(20,5) DEFAULT 0.00000 NOT NULL, -PRIMARY KEY (`id`), -UNIQUE `user_refid` (`userid`, `level`, `refid`), -INDEX (`level`), -INDEX (`refid`)", - 'User Referals With Refback'); - addMemberMenuSql('main', 'refback', 'Ref-Back einstellen', 4); + // Member menu + addMemberMenuSql('main', 'refback', 'Refback einstellen', 4); // Execute this special file on registration - addIncludeToPool('extension', 'inc/gen_refback.php'); + addIncludeToPool('extension', 'inc/fix_refsystem.php'); break; case 'remove': // Do stuff when removing extension // SQL commands to run - addDropTableSql('user_refs'); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='refback'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_refback','list_refback')"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET level=level-1"); break; case 'activate': // Do stuff when admin activates this extension @@ -100,21 +85,30 @@ INDEX (`refid`)", break; case '0.0.2': // SQL queries for v0.0.2 - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `userid` `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `level` `level` SMALLINT(6) UNSIGNED NULL DEFAULT NULL'); - addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` CHANGE `refid` `refid` BIGINT(20) UNSIGNED NULL DEFAULT NULL'); - addExtensionSql('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid` IS NULL OR `refid` IS NULL OR `level` IS NULL'); - // Update notes (these will be set as task text!) - setExtensionUpdateNotes("Updates von ext-user hier her verschoben."); + setExtensionUpdateNotes("Ungütiges Update seit Revision 246x."); break; case '0.0.3': // SQL queries for v0.0.3 - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`, `column_name`, `locked_mode`, `payment_method`) VALUES ('refback','points','LOCKED','DIRECT')"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('refback','points','LOCKED','DIRECT')"); // This depends on ext-sql_patches addExtensionDependency('sql_patches'); + // Update notes + setExtensionUpdateNotes("Refback-Gutschriften werden nun über die Tabelle {OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data verwaltet."); + break; + + case '0.0.4': // SQL queries for v0.0.4 + // This extension update depends on ext-sql_patches + addExtensionDependency('user'); + + // SQL commands to run - drop old first, add new next + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` DROP `refback`'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` DROP `points`'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` ADD `refback_percents` FLOAT(4,1) NOT NULL DEFAULT 0.0'); + addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_refs` ADD `refback_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000'); + // Update notes setExtensionUpdateNotes("Refback-Gutschriften werden nun über die Tabelle {OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data verwaltet."); break;