]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-bonus.php
Deprecated 'replacer' removed. Now we use EL code instead (there are a lot example...
[mailer.git] / inc / extensions / ext-bonus.php
index 2e83eba753da03bd0c0d39a024fb5b3e6ecaee3a..c1e40a09aac428e3353cf6a360d4e1600f6d6056 100644 (file)
@@ -14,8 +14,6 @@
  * $Date::                                                            $ *
  * $Tag:: 0.2.1-FINAL                                                 $ *
  * $Author::                                                          $ *
- * Needs to be in all Files and every File needs "svn propset           *
- * svn:keywords Date Revision" (autoprobset!) at least!!!!!!            *
  * -------------------------------------------------------------------- *
  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
  * Copyright (c) 2009, 2010 by Mailer Developer Team                    *
@@ -50,6 +48,9 @@ setExtensionVersionHistory(array('0.0', '0.1.6', '0.2.0', '0.2.1', '0.2.2', '0.2
 
 switch (getExtensionMode()) {
        case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+               // Add dependency to 'user'
+               addExtensionDependency('user');
+
                // SQL commands to run
                addAdminMenuSql('email','send_bonus','Bonusmail senden','Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.', 5);
                addMemberMenuSql('main','bonus','Bonuspunkte','N','Y',7);
@@ -70,12 +71,12 @@ switch (getExtensionMode()) {
 `mails_sent` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 KEY (`cat_id`),
 PRIMARY KEY  (`id`)
-)TYPE={?_TABLE_TYPE?} COMMENT='Bonus mails'");
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Bonus mails'");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` MODIFY `link_type` ENUM('NORMAL','BONUS') NOT NULL DEFAULT 'NORMAL'");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD `bonus_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_links` ADD INDEX (`bonus_id`)");
 
-               // Run this SQL when html or html_mail extension is installed
+               // Run this SQL when html_mail extension is installed
                if (isExtensionActive('html_mail')) addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_bonus` ADD `html_msg` ENUM('Y','N') NOT NULL DEFAULT 'N'");
                break;
 
@@ -150,7 +151,7 @@ PRIMARY KEY (`id`),
 INDEX `mail_id` (`mail_id`),
 INDEX `bonus_id` (`bonus_id`),
 INDEX `userid` (`userid`)
-) TYPE={?_TABLE_TYPE?}");
+) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci");
 
                                // Update notes (these will be set as task text!)
                                setExtensionUpdateNotes("Turbo-Bonus wird in Tabelle gezählt für Anzeige, wer alles bereits geklickt hat und welchen Platz er gemacht hat.");
@@ -260,7 +261,7 @@ INDEX `userid` (`userid`)
                                break;
 
                        case '0.4.0': // SQL queries for v0.4.0
-                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*7)."");
+                               addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getOneDay()*7)."");
                                addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_lines` BIGINT(20) UNSIGNED NOT NULL DEFAULT 10");
 
                                // Update notes (these will be set as task text!)