The yearly copyright-update commit. 2009, 2010 are now copyrighted on the developer...
[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  * 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                  *
23  *                                                                      *
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.                                  *
28  *                                                                      *
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.                         *
33  *                                                                      *
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,               *
37  * MA  02110-1301  USA                                                  *
38  ************************************************************************/
39
40 // Some security stuff...
41 if (!defined('__SECURITY')) {
42         die();
43 }
44
45 // Version number
46 setThisExtensionVersion('0.3.9');
47
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'));
50
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");
55                 break;
56
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'");
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                                 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 '',
89 KEY (userid),
90 PRIMARY KEY (id)
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);
93
94                                 // Update notes (these will be set as task text!)
95                                 setExtensionUpdateNotes("Es kann nun eine Gutschrift an die Geburtstagmail angeh&auml;ngt werden. Diese wird erst beim Klick auf einen Best&auml;tigungslink gutgeschrieben.");
96                                 break;
97
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&ouml;ht.");
101                                 break;
102
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 &quot;intelligenter&quot; per Datenfeld und Lade-Schleife in load_extensions.php realisiert.");
106                                 break;
107
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.");
111                                 break;
112
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.");
116                                 break;
117
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&uuml;hrt.");
121                                 break;
122
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.");
126                                 break;
127
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> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
131                                 break;
132
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.");
136                                 break;
137
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.");
141                                 break;
142
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&uuml;tzt.");
146                                 break;
147
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!");
151                                 break;
152
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.");
156                                 break;
157
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.");
161                                 break;
162
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'");
166
167                                 // Update notes (these will be set as task text!)
168                                 setExtensionUpdateNotes("Verg&uuml;tungsmodus des Geburtstagsbonus einstellbar.");
169                                 break;
170
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&ouml;hnliche Leerstelle aussah.");
174                                 break;
175
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.");
179                                 break;
180
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");
185
186                                 // Update notes (these will be set as task text!)
187                                 setExtensionUpdateNotes("Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.");
188                                 break;
189                 }
190                 break;
191
192         case 'modify': // When the extension got modified
193                 break;
194
195         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
196                 break;
197
198         case 'init': // Do stuff when extension is initialized
199                 break;
200
201         default: // Unknown extension mode
202                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
203                 break;
204 }
205
206 // [EOF]
207 ?>