2 /************************************************************************
3 * Mailer v0.2.1-FINAL Start: 05/23/2004 *
4 * =================== Last change: 06/26/2004 *
6 * -------------------------------------------------------------------- *
7 * File : ext-birthday.php *
8 * -------------------------------------------------------------------- *
9 * Short description : Sends out happy-birthday mails *
10 * -------------------------------------------------------------------- *
11 * Kurzbeschreibung : Versendet Geburtstagsmails an die Mitglieder *
12 * -------------------------------------------------------------------- *
15 * $Tag:: 0.2.1-FINAL $ *
17 * -------------------------------------------------------------------- *
18 * Copyright (c) 2003 - 2009 by Roland Haeder *
19 * Copyright (c) 2009 - 2011 by Mailer Developer Team *
20 * For more information visit: http://www.mxchange.org *
22 * This program is free software; you can redistribute it and/or modify *
23 * it under the terms of the GNU General Public License as published by *
24 * the Free Software Foundation; either version 2 of the License, or *
25 * (at your option) any later version. *
27 * This program is distributed in the hope that it will be useful, *
28 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
29 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
30 * GNU General Public License for more details. *
32 * You should have received a copy of the GNU General Public License *
33 * along with this program; if not, write to the Free Software *
34 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
36 ************************************************************************/
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
44 setThisExtensionVersion('0.3.9');
46 // Version history array (add more with , '0.1.0' and so on)
47 setExtensionVersionHistory(array('0.0', '0.1.0', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9'));
49 switch (getExtensionMode()) {
50 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
51 // SQL commands to run
52 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD birthday_sent VARCHAR(10) NOT NULL DEFAULT 0");
55 case 'remove': // Do stuff when removing extension
56 // SQL commands to run
57 addDropTableSql('user_birthday');
58 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_birthday' LIMIT 1");
61 case 'activate': // Do stuff when admin activates this extension
62 // SQL commands to run
66 case 'deactivate': // Do stuff when admin deactivates this extension
67 // SQL commands to run
71 case 'update': // Update an extension
72 switch (getCurrentExtensionVersion()) {
73 case '0.1.0': // SQL queries for v0.1
74 // Update notes (these will be set as task text!)
75 setExtensionUpdateNotes("Wenn täglicher Reset war, wird eine benötigte Include-Datei nicht mehr von daily-reset.php eingebunden, sondern von der Erweiterungsdatei selber.");
78 case '0.2.0': // SQL queries for v0.2
79 addConfigAddSql('birthday_points', "BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
80 addDropTableSql('user_birthday');
81 addCreateTableSql('user_birthday', "(
82 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
83 `userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
84 `points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
85 `chk_value` VARCHAR(255) NOT NULL DEFAULT '',
88 ) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT = 'Pending birthday codes'");
89 addAdminMenuSql('setup','config_birthday','Geburtstagsmails','Stellen Sie hier ein, ob die Mitglieder {OPEN_CONFIG}POINTS{CLOSE_CONFIG} (nicht automatisch) gutgeschrieben kommen sollen oder nicht.', 9);
91 // Update notes (these will be set as task text!)
92 setExtensionUpdateNotes("Es kann nun eine Gutschrift an die Geburtstagmail angehängt werden. Diese wird erst beim Klick auf einen Bestätigungslink gutgeschrieben.");
95 case '0.2.1': // SQL queries for v0.2.1
96 // Update notes (these will be set as task text!)
97 setExtensionUpdateNotes("Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erhöht.");
100 case '0.2.4': // SQL queries for v0.2.4
101 // Update notes (these will be set as task text!)
102 setExtensionUpdateNotes("Laden der birthday_mails.php "intelligenter" per Datenfeld und Lade-Schleife in load_extensions.php realisiert.");
105 case '0.2.5': // SQL queries for v0.2.5
106 // Update notes (these will be set as task text!)
107 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
110 case '0.2.6': // SQL queries for v0.2.6
111 // Update notes (these will be set as task text!)
112 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
115 case '0.2.7': // SQL queries for v0.2.7
116 // Update notes (these will be set as task text!)
117 setExtensionUpdateNotes("Sicherheitsupdate am Script <u>birtday_confirm.php</u> durchgeführt.");
120 case '0.2.8': // SQL queries for v0.2.8
121 // Update notes (these will be set as task text!)
122 setExtensionUpdateNotes("Vergessenes <strong>_OB_CACHING</strong> gesetzt.");
125 case '0.2.9': // SQL queries for v0.2.9
126 // Update notes (these will be set as task text!)
127 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
130 case '0.3.0': // SQL queries for v0.3.0
131 // Update notes (these will be set as task text!)
132 setExtensionUpdateNotes("Ausgabe des generierten HTML-Codes nach <u>inc/footer.php</u> verlagert.");
135 case '0.3.1': // SQL queries for v0.3.1
136 // Update notes (these will be set as task text!)
137 setExtensionUpdateNotes("Wort <strong>Punkte</strong> dynamisiert.");
140 case '0.3.2': // SQL queries for v0.3.2
141 // Update notes (these will be set as task text!)
142 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
145 case '0.3.3': // SQL queries for v0.3.3
146 // Update notes (these will be set as task text!)
147 setExtensionUpdateNotes("Bitte verschieben Sie die birthday-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order birthday!");
150 case '0.3.4': // SQL queries for v0.3.4
151 // Update notes (these will be set as task text!)
152 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
155 case '0.3.5': // SQL queries for v0.3.5
156 // Update notes (these will be set as task text!)
157 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
160 case '0.3.6': // SQL queries for v0.3.6
161 addConfigAddSql('birthday_mode', "ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'");
162 addConfigAddSql('birthday_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
164 // Update notes (these will be set as task text!)
165 setExtensionUpdateNotes("Vergütungsmodus des Geburtstagsbonus einstellbar.");
168 case '0.3.7': // SQL queries for v0.3.7
169 // Update notes (these will be set as task text!)
170 setExtensionUpdateNotes("Im Script <strong>inc/birthday_mails.php</strong> hat sich ein Zeichen mit dem Code 160 eingeschlichen, welches einen <strong>Parser Error</strong> verursachte, aber wie eine gewöhnliche Leerstelle aussah.");
173 case '0.3.8': // SQL queries for v0.3.8
174 // Update notes (these will be set as task text!)
175 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
178 case '0.3.9': // SQL queries for v0.3.9
179 addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data`
180 CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 01,
181 CHANGE `birth_month` `birth_month` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 01,
182 CHANGE `birth_year` `birth_year` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT 1970');
184 // Update notes (these will be set as task text!)
185 setExtensionUpdateNotes("Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.");
190 case 'modify': // When the extension got modified
193 case 'test': // For testing purposes
196 case 'init': // Do stuff when extension is initialized
199 default: // Unknown extension mode
200 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));