Moved "fix" files (which only helps to fix stuff) in own inc/fixes/ folder.
[mailer.git] / inc / extensions / ext-birthday.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 05/23/2004 *
4  * ===================                          Last change: 06/26/2004 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : ext-birthday.php                                 *
8  * -------------------------------------------------------------------- *
9  * Short description : Sends out happy-birthday mails                   *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Versendet Geburtstagsmails an die Mitglieder     *
12  * -------------------------------------------------------------------- *
13  * $Revision::                                                        $ *
14  * $Date::                                                            $ *
15  * $Tag:: 0.2.1-FINAL                                                 $ *
16  * $Author::                                                          $ *
17  * -------------------------------------------------------------------- *
18  * Copyright (c) 2003 - 2009 by Roland Haeder                           *
19  * Copyright (c) 2009 - 2016 by Mailer Developer Team                   *
20  * For more information visit: http://mxchange.org                      *
21  *                                                                      *
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.                                  *
26  *                                                                      *
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.                         *
31  *                                                                      *
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,               *
35  * MA  02110-1301  USA                                                  *
36  ************************************************************************/
37
38 // Some security stuff...
39 if (!defined('__SECURITY')) {
40         die();
41 } // END - if
42
43 // Version number
44 setThisExtensionVersion('0.4.1');
45
46 // Version history array (add more with , '0.0.1' and so on)
47 setExtensionVersionHistory(array('0.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', '0.4.1'));
48
49 switch (getExtensionMode()) {
50         case 'setup': // Do stuff when installation is running
51                 // SQL commands to run
52                 addExtensionAddTableColumnSql('user_data', 'birthday_sent', 'VARCHAR(10) NOT NULL DEFAULT 0');
53                 break;
54
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");
59
60                 // Unregister points data
61                 unregisterExtensionPointsData('birthday_confirm');
62                 break;
63
64         case 'activate': // Do stuff when admin activates this extension
65                 // SQL commands to run
66                 addExtensionSql('');
67                 break;
68
69         case 'deactivate': // Do stuff when admin deactivates this extension
70                 // SQL commands to run
71                 addExtensionSql('');
72                 break;
73
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&auml;glicher Reset war, wird eine ben&ouml;tigte Include-Datei nicht mehr von daily-reset.php eingebunden, sondern von der Erweiterungsdatei selber.");
79                                 break;
80
81                         case '0.2.0': // SQL queries for v0.2
82                                 addConfigAddSql('birthday_points', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
83                                 addDropTableSql('user_birthday');
84                                 addCreateTableSql('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 '',
89 PRIMARY KEY (`id`),
90 INDEX (`userid`)",
91                                         'Pending birthday codes');
92
93                                 // Admin menu
94                                 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);
95
96                                 // Update notes (these will be set as task text!)
97                                 setExtensionUpdateNotes("Es kann nun eine Gutschrift an die Geburtstagmail angeh&auml;ngt werden. Diese wird erst beim Klick auf einen Best&auml;tigungslink gutgeschrieben.");
98                                 break;
99
100                         case '0.2.1': // SQL queries for v0.2.1
101                                 // Update notes (these will be set as task text!)
102                                 setExtensionUpdateNotes("Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erh&ouml;ht.");
103                                 break;
104
105                         case '0.2.4': // SQL queries for v0.2.4
106                                 // Update notes (these will be set as task text!)
107                                 setExtensionUpdateNotes("Laden der birthday_mails.php &quot;intelligenter&quot; per Datenfeld und Lade-Schleife in load_extensions.php realisiert.");
108                                 break;
109
110                         case '0.2.5': // SQL queries for v0.2.5
111                                 // Update notes (these will be set as task text!)
112                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
113                                 break;
114
115                         case '0.2.6': // SQL queries for v0.2.6
116                                 // Update notes (these will be set as task text!)
117                                 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
118                                 break;
119
120                         case '0.2.7': // SQL queries for v0.2.7
121                                 // Update notes (these will be set as task text!)
122                                 setExtensionUpdateNotes("Sicherheitsupdate am Script <u>birtday_confirm.php</u> durchgef&uuml;hrt.");
123                                 break;
124
125                         case '0.2.8': // SQL queries for v0.2.8
126                                 // Update notes (these will be set as task text!)
127                                 setExtensionUpdateNotes("Vergessenes <strong>_OB_CACHING</strong> gesetzt.");
128                                 break;
129
130                         case '0.2.9': // SQL queries for v0.2.9
131                                 // Update notes (these will be set as task text!)
132                                 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
133                                 break;
134
135                         case '0.3.0': // SQL queries for v0.3.0
136                                 // Update notes (these will be set as task text!)
137                                 setExtensionUpdateNotes("Ausgabe des generierten HTML-Codes nach <u>inc/footer.php</u> verlagert.");
138                                 break;
139
140                         case '0.3.1': // SQL queries for v0.3.1
141                                 // Update notes (these will be set as task text!)
142                                 setExtensionUpdateNotes("Wort <strong>Punkte</strong> dynamisiert.");
143                                 break;
144
145                         case '0.3.2': // SQL queries for v0.3.2
146                                 // Update notes (these will be set as task text!)
147                                 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.");
148                                 break;
149
150                         case '0.3.3': // SQL queries for v0.3.3
151                                 // Update notes (these will be set as task text!)
152                                 setExtensionUpdateNotes("Bitte verschieben Sie die birthday-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order birthday!");
153                                 break;
154
155                         case '0.3.4': // SQL queries for v0.3.4
156                                 // Update notes (these will be set as task text!)
157                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
158                                 break;
159
160                         case '0.3.5': // SQL queries for v0.3.5
161                                 // Update notes (these will be set as task text!)
162                                 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
163                                 break;
164
165                         case '0.3.6': // SQL queries for v0.3.6
166                                 addConfigAddSql('birthday_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
167
168                                 // Update notes (these will be set as task text!)
169                                 setExtensionUpdateNotes("Verg&uuml;tungsmodus des Geburtstagsbonus einstellbar.");
170                                 break;
171
172                         case '0.3.7': // SQL queries for v0.3.7
173                                 // Update notes (these will be set as task text!)
174                                 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&ouml;hnliche Leerstelle aussah.");
175                                 break;
176
177                         case '0.3.8': // SQL queries for v0.3.8
178                                 // Update notes (these will be set as task text!)
179                                 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
180                                 break;
181
182                         case '0.3.9': // SQL queries for v0.3.9
183                                 addExtensionChangeTableColumnSql('user_data', 'birth_day', 'birth_day', 'SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 01');
184                                 addExtensionChangeTableColumnSql('user_data', 'birth_month', 'birth_month', 'SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT 01');
185                                 addExtensionChangeTableColumnSql('user_data', 'birth_year', 'birth_year', 'SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT 1970');
186
187                                 // This update depends on ext-user
188                                 addExtensionDependency('user');
189
190                                 // Update notes (these will be set as task text!)
191                                 setExtensionUpdateNotes("Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.");
192                                 break;
193
194                         case '0.4.0': // SQL queries for v0.4.0
195                                 addConfigDropSql('birthday_mode');
196
197                                 // Update notes (these will be set as task text!)
198                                 setExtensionUpdateNotes("Dies brauchen wir nicht mehr.");
199                                 break;
200
201                         case '0.4.1': // SQL queries for v0.4.1
202                                 // Register points data
203                                 registerExtensionPointsData('birthday_confirm', 'points', 'LOCKED', 'DIRECT');
204
205                                 // Update notes (these will be set as task text!)
206                                 setExtensionUpdateNotes("Eintrag in Tabelle <strong>{?_MYSQL_PREFIX?}_points_data</strong> hinzugef&uum;gt.");
207                                 break;
208                 } // END - switch
209                 break;
210
211         case 'modify': // When the extension got modified
212                 break;
213
214         case 'test': // For testing purposes
215                 break;
216
217         case 'init': // Do stuff when extension is initialized
218                 break;
219
220         default: // Unknown extension mode
221                 reportBug(__FILE__, __LINE__, sprintf('Unknown extension mode %s in extension %s detected.', getExtensionMode(), getCurrentExtensionName()));
222                 break;
223 } // END - switch
224
225 // [EOF]
226 ?>