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 * Needs to be in all Files and every File needs "svn propset *
18 * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
19 * -------------------------------------------------------------------- *
20 * Copyright (c) 2003 - 2009 by Roland Haeder *
21 * Copyright (c) 2009, 2010 by Mailer Developer Team *
22 * For more information visit: http://www.mxchange.org *
24 * This program is free software; you can redistribute it and/or modify *
25 * it under the terms of the GNU General Public License as published by *
26 * the Free Software Foundation; either version 2 of the License, or *
27 * (at your option) any later version. *
29 * This program is distributed in the hope that it will be useful, *
30 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
31 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
32 * GNU General Public License for more details. *
34 * You should have received a copy of the GNU General Public License *
35 * along with this program; if not, write to the Free Software *
36 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
38 ************************************************************************/
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
46 setThisExtensionVersion('0.3.9');
48 // Version history array (add more with , '0.1.0' and so on)
49 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'));
51 switch (getExtensionMode()) {
52 case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
53 // SQL commands to run
54 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD birthday_sent VARCHAR(10) NOT NULL DEFAULT 0");
57 case 'remove': // Do stuff when removing extension
58 // SQL commands to run
59 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP birthday_sent");
60 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
61 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_birthday'");
64 case 'activate': // Do stuff when admin activates this extension
65 // SQL commands to run
69 case 'deactivate': // Do stuff when admin deactivates this extension
70 // SQL commands to run
74 case 'update': // Update an extension
75 switch (getCurrentExtensionVersion()) {
76 case '0.1.0': // SQL queries for v0.1
77 // Update notes (these will be set as task text!)
78 setExtensionUpdateNotes("Wenn täglicher Reset war, wird eine benötigte Include-Datei nicht mehr von daily-reset.php eingebunden, sondern von der Erweiterungsdatei selber.");
81 case '0.2.0': // SQL queries for v0.2
82 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `birthday_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
83 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
84 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_birthday` (
85 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
86 userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
87 points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
88 chk_value VARCHAR(255) NOT NULL DEFAULT '',
91 ) Type={?_TABLE_TYPE?}");
92 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);
94 // Update notes (these will be set as task text!)
95 setExtensionUpdateNotes("Es kann nun eine Gutschrift an die Geburtstagmail angehängt werden. Diese wird erst beim Klick auf einen Bestätigungslink gutgeschrieben.");
98 case '0.2.1': // SQL queries for v0.2.1
99 // Update notes (these will be set as task text!)
100 setExtensionUpdateNotes("Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erhöht.");
103 case '0.2.4': // SQL queries for v0.2.4
104 // Update notes (these will be set as task text!)
105 setExtensionUpdateNotes("Laden der birthday_mails.php "intelligenter" per Datenfeld und Lade-Schleife in load_extensions.php realisiert.");
108 case '0.2.5': // SQL queries for v0.2.5
109 // Update notes (these will be set as task text!)
110 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
113 case '0.2.6': // SQL queries for v0.2.6
114 // Update notes (these will be set as task text!)
115 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
118 case '0.2.7': // SQL queries for v0.2.7
119 // Update notes (these will be set as task text!)
120 setExtensionUpdateNotes("Sicherheitsupdate am Script <u>birtday_confirm.php</u> durchgeführt.");
123 case '0.2.8': // SQL queries for v0.2.8
124 // Update notes (these will be set as task text!)
125 setExtensionUpdateNotes("Vergessenes <strong>_OB_CACHING</strong> gesetzt.");
128 case '0.2.9': // SQL queries for v0.2.9
129 // Update notes (these will be set as task text!)
130 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> überflüssige HTML-Tags entfernt.");
133 case '0.3.0': // SQL queries for v0.3.0
134 // Update notes (these will be set as task text!)
135 setExtensionUpdateNotes("Ausgabe des generierten HTML-Codes nach <u>inc/footer.php</u> verlagert.");
138 case '0.3.1': // SQL queries for v0.3.1
139 // Update notes (these will be set as task text!)
140 setExtensionUpdateNotes("Wort <strong>Punkte</strong> dynamisiert.");
143 case '0.3.2': // SQL queries for v0.3.2
144 // Update notes (these will be set as task text!)
145 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen geschützt.");
148 case '0.3.3': // SQL queries for v0.3.3
149 // Update notes (these will be set as task text!)
150 setExtensionUpdateNotes("Bitte verschieben Sie die birthday-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order birthday!");
153 case '0.3.4': // SQL queries for v0.3.4
154 // Update notes (these will be set as task text!)
155 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
158 case '0.3.5': // SQL queries for v0.3.5
159 // Update notes (these will be set as task text!)
160 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
163 case '0.3.6': // SQL queries for v0.3.6
164 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD birthday_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'");
165 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD birthday_active ENUM('Y','N') NOT NULL DEFAULT 'N'");
167 // Update notes (these will be set as task text!)
168 setExtensionUpdateNotes("Vergütungsmodus des Geburtstagsbonus einstellbar.");
171 case '0.3.7': // SQL queries for v0.3.7
172 // Update notes (these will be set as task text!)
173 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.");
176 case '0.3.8': // SQL queries for v0.3.8
177 // Update notes (these will be set as task text!)
178 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
181 case '0.3.9': // SQL queries for v0.3.9
182 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
183 CHANGE `birth_month` `birth_month` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
184 CHANGE `birth_year` `birth_year` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT 1970");
186 // Update notes (these will be set as task text!)
187 setExtensionUpdateNotes("Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.");
192 case 'modify': // When the extension got modified
195 case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
198 case 'init': // Do stuff when extension is initialized
201 default: // Unknown extension mode
202 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));