Removed comment introduced by Profi-Concept, this comment should fine (in a much...
[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, 2010 by Mailer Developer Team                    *
20  * For more information visit: http://www.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.3.9');
45
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'));
48
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");
53                 break;
54
55         case 'remove': // Do stuff when removing extension
56                 // SQL commands to run
57                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP birthday_sent");
58                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
59                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_birthday'");
60                 break;
61
62         case 'activate': // Do stuff when admin activates this extension
63                 // SQL commands to run
64                 addExtensionSql('');
65                 break;
66
67         case 'deactivate': // Do stuff when admin deactivates this extension
68                 // SQL commands to run
69                 addExtensionSql('');
70                 break;
71
72         case 'update': // Update an extension
73                 switch (getCurrentExtensionVersion()) {
74                         case '0.1.0': // SQL queries for v0.1
75                                 // Update notes (these will be set as task text!)
76                                 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.");
77                                 break;
78
79                         case '0.2.0': // SQL queries for v0.2
80                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `birthday_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
81                                 addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
82                                 addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_birthday` (
83 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
84 userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
85 points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
86 chk_value VARCHAR(255) NOT NULL DEFAULT '',
87 KEY (userid),
88 PRIMARY KEY (id)
89 ) Type={?_TABLE_TYPE?}");
90                                 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
92                                 // Update notes (these will be set as task text!)
93                                 setExtensionUpdateNotes("Es kann nun eine Gutschrift an die Geburtstagmail angeh&auml;ngt werden. Diese wird erst beim Klick auf einen Best&auml;tigungslink gutgeschrieben.");
94                                 break;
95
96                         case '0.2.1': // SQL queries for v0.2.1
97                                 // Update notes (these will be set as task text!)
98                                 setExtensionUpdateNotes("Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erh&ouml;ht.");
99                                 break;
100
101                         case '0.2.4': // SQL queries for v0.2.4
102                                 // Update notes (these will be set as task text!)
103                                 setExtensionUpdateNotes("Laden der birthday_mails.php &quot;intelligenter&quot; per Datenfeld und Lade-Schleife in load_extensions.php realisiert.");
104                                 break;
105
106                         case '0.2.5': // SQL queries for v0.2.5
107                                 // Update notes (these will be set as task text!)
108                                 setExtensionUpdateNotes("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.");
109                                 break;
110
111                         case '0.2.6': // SQL queries for v0.2.6
112                                 // Update notes (these will be set as task text!)
113                                 setExtensionUpdateNotes("Problem mit Speicherung der Einstellungen beseitigt.");
114                                 break;
115
116                         case '0.2.7': // SQL queries for v0.2.7
117                                 // Update notes (these will be set as task text!)
118                                 setExtensionUpdateNotes("Sicherheitsupdate am Script <u>birtday_confirm.php</u> durchgef&uuml;hrt.");
119                                 break;
120
121                         case '0.2.8': // SQL queries for v0.2.8
122                                 // Update notes (these will be set as task text!)
123                                 setExtensionUpdateNotes("Vergessenes <strong>_OB_CACHING</strong> gesetzt.");
124                                 break;
125
126                         case '0.2.9': // SQL queries for v0.2.9
127                                 // Update notes (these will be set as task text!)
128                                 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
129                                 break;
130
131                         case '0.3.0': // SQL queries for v0.3.0
132                                 // Update notes (these will be set as task text!)
133                                 setExtensionUpdateNotes("Ausgabe des generierten HTML-Codes nach <u>inc/footer.php</u> verlagert.");
134                                 break;
135
136                         case '0.3.1': // SQL queries for v0.3.1
137                                 // Update notes (these will be set as task text!)
138                                 setExtensionUpdateNotes("Wort <strong>Punkte</strong> dynamisiert.");
139                                 break;
140
141                         case '0.3.2': // SQL queries for v0.3.2
142                                 // Update notes (these will be set as task text!)
143                                 setExtensionUpdateNotes("Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.");
144                                 break;
145
146                         case '0.3.3': // SQL queries for v0.3.3
147                                 // Update notes (these will be set as task text!)
148                                 setExtensionUpdateNotes("Bitte verschieben Sie die birthday-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order birthday!");
149                                 break;
150
151                         case '0.3.4': // SQL queries for v0.3.4
152                                 // Update notes (these will be set as task text!)
153                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
154                                 break;
155
156                         case '0.3.5': // SQL queries for v0.3.5
157                                 // Update notes (these will be set as task text!)
158                                 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
159                                 break;
160
161                         case '0.3.6': // SQL queries for v0.3.6
162                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD birthday_mode ENUM('DIRECT','REF') NOT NULL DEFAULT 'DIRECT'");
163                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD birthday_active ENUM('Y','N') NOT NULL DEFAULT 'N'");
164
165                                 // Update notes (these will be set as task text!)
166                                 setExtensionUpdateNotes("Verg&uuml;tungsmodus des Geburtstagsbonus einstellbar.");
167                                 break;
168
169                         case '0.3.7': // SQL queries for v0.3.7
170                                 // Update notes (these will be set as task text!)
171                                 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.");
172                                 break;
173
174                         case '0.3.8': // SQL queries for v0.3.8
175                                 // Update notes (these will be set as task text!)
176                                 setExtensionUpdateNotes("Hash-Erstellung von <strong>md5()</strong> auf bessere Funktion <strong>generateHash()</strong> umgestellt.");
177                                 break;
178
179                         case '0.3.9': // SQL queries for v0.3.9
180                                 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` 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");
183
184                                 // Update notes (these will be set as task text!)
185                                 setExtensionUpdateNotes("Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.");
186                                 break;
187                 }
188                 break;
189
190         case 'modify': // When the extension got modified
191                 break;
192
193         case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
194                 break;
195
196         case 'init': // Do stuff when extension is initialized
197                 break;
198
199         default: // Unknown extension mode
200                 logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
201                 break;
202 }
203
204 // [EOF]
205 ?>