]> git.mxchange.org Git - mailer.git/blob - inc/extensions/ext-birthday.php
1893fec46f963317d5235e44571215c8f3b377ad
[mailer.git] / inc / extensions / ext-birthday.php
1 <?php
2 /************************************************************************
3  * MXChange v0.2.1                                    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  *                                                                      *
14  * -------------------------------------------------------------------- *
15  * Copyright (c) 2003 - 2008 by Roland Haeder                           *
16  * For more information visit: http://www.mxchange.org                  *
17  *                                                                      *
18  * This program is free software; you can redistribute it and/or modify *
19  * it under the terms of the GNU General Public License as published by *
20  * the Free Software Foundation; either version 2 of the License, or    *
21  * (at your option) any later version.                                  *
22  *                                                                      *
23  * This program is distributed in the hope that it will be useful,      *
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *
26  * GNU General Public License for more details.                         *
27  *                                                                      *
28  * You should have received a copy of the GNU General Public License    *
29  * along with this program; if not, write to the Free Software          *
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *
31  * MA  02110-1301  USA                                                  *
32  ************************************************************************/
33
34 // Some security stuff...
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
36 {
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
38         require($INC);
39 }
40
41 // Version number
42 $EXT_VERSION = "0.3.9";
43
44 // Auto-set extension version
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
46
47 // Version history array (add more with , "0.1" and so on)
48 $EXT_VER_HISTORY = array("0.0", "0.1", "0.2", "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
50 switch ($EXT_LOAD_MODE)
51 {
52 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
53         // SQL commands to run
54         $SQLs[] = "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         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP birthday_sent";
60         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_birthday";
61         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_birthday' LIMIT 1";
62         break;
63
64 case "activate": // Do stuff when admin activates this extension
65         // SQL commands to run
66         $SQLs[] = "";
67         break;
68
69 case "deactivate": // Do stuff when admin deactivates this extension
70         // SQL commands to run
71         $SQLs[] = "";
72         break;
73
74 case "update": // Update an extension
75         switch ($EXT_VER)
76         {
77         case "0.1": // SQL queries for v0.1
78                 // Update notes (these will be set as task text!)
79                 $UPDATE_NOTES = "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.";
80                 break;
81
82         case "0.2": // SQL queries for v0.2
83                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0'";
84                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_birthday";
85                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_birthday (
86 id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
87 userid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
88 points BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
89 chk_value VARCHAR(255) NOT NULL DEFAULT '',
90 KEY(userid),
91 PRIMARY KEY(id)
92 ) Type=MyISAM";
93                 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, descr, sort) VALUES ('setup', 'config_birthday', 'Geburtstagsmails', 'Stellen Sie hier ein, ob die Mitglieder {!POINTS!} (nicht automatisch) gutgeschrieben kommen sollen oder nicht.', 9)";
94
95                 // Update notes (these will be set as task text!)
96                 $UPDATE_NOTES = "Es kann nun eine Gutschrift an die Geburtstagmail angeh&auml;ngt werden. Diese wird erst beim Klick auf einen Best&auml;tigungslink gutgeschrieben.";
97                 break;
98
99         case "0.2.1": // SQL queries for v0.2.1
100                 // Update notes (these will be set as task text!)
101                 $UPDATE_NOTES = "Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erh&ouml;ht.";
102                 break;
103
104         case "0.2.4": // SQL queries for v0.2.4
105                 // Update notes (these will be set as task text!)
106                 $UPDATE_NOTES = "Laden der birthday_mails.php &quot;intelligenter&quot; per Datenfeld und Lade-Schleife in load_extensions.php realisiert.";
107                 break;
108
109         case "0.2.5": // SQL queries for v0.2.5
110                 // Update notes (these will be set as task text!)
111                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
112                 break;
113
114         case "0.2.6": // SQL queries for v0.2.6
115                 // Update notes (these will be set as task text!)
116                 $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
117                 break;
118
119         case "0.2.7": // SQL queries for v0.2.7
120                 // Update notes (these will be set as task text!)
121                 $UPDATE_NOTES = "Sicherheitsupdate am Script <U>birtday_confirm.php</U> durchgef&uuml;hrt.";
122                 break;
123
124         case "0.2.8": // SQL queries for v0.2.8
125                 // Update notes (these will be set as task text!)
126                 $UPDATE_NOTES = "Vergessenes _OB_CACHING gesetzt.";
127                 break;
128
129         case "0.2.9": // SQL queries for v0.2.9
130                 // Update notes (these will be set as task text!)
131                 $UPDATE_NOTES = "Seit <A href=\"#\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";
132                 break;
133
134         case "0.3.0": // SQL queries for v0.3.0
135                 // Update notes (these will be set as task text!)
136                 $UPDATE_NOTES = "Ausgabe des generierten HTML-Codes nach <U>inc/footer.php</U> verlagert.";
137                 break;
138
139         case "0.3.1": // SQL queries for v0.3.1
140                 // Update notes (these will be set as task text!)
141                 $UPDATE_NOTES = "Wort <STRONG>Punkte</STRONG> dynamisiert.";
142                 break;
143
144         case "0.3.2": // SQL queries for v0.3.2
145                 // Update notes (these will be set as task text!)
146                 $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";
147                 break;
148
149         case "0.3.3": // SQL queries for v0.3.3
150                 // Update notes (these will be set as task text!)
151                 $UPDATE_NOTES = "Bitte verschieben Sie die birthday-Templates (Ordner: ".PATH."/templates/".GET_LANGUAGE()."/html/) in den neuen Order birthday!";
152                 break;
153
154         case "0.3.4": // SQL queries for v0.3.4
155                 // Update notes (these will be set as task text!)
156                 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
157                 break;
158
159         case "0.3.5": // SQL queries for v0.3.5
160                 // Update notes (these will be set as task text!)
161                 $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
162                 break;
163
164         case "0.3.6": // SQL queries for v0.3.6
165                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_mode ENUM('DIRECT', 'REF') NOT NULL DEFAULT 'DIRECT'";
166                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_active ENUM('Y', 'N') NOT NULL DEFAULT 'N'";
167
168                 // Update notes (these will be set as task text!)
169                 $UPDATE_NOTES = "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                 $UPDATE_NOTES = "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                 $UPDATE_NOTES = "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.8
183                 $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` CHANGE `birth_day` `birth_day` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
184 CHANGE `birth_month` `birth_month` SMALLINT(2) UNSIGNED ZEROFILL NOT NULL DEFAULT '01',
185 CHANGE `birth_year` `birth_year` SMALLINT(4) UNSIGNED ZEROFILL NOT NULL DEFAULT '1970'";
186
187                 // Update notes (these will be set as task text!)
188                 $UPDATE_NOTES = "Datenbankspalten umgestellt auf SMALLINT() UNSIGNED ZEROFILL.";
189                 break;
190         }
191         break;
192
193 default: // Do stuff when extension is loaded
194         if ((isBooleanConstantAndTrue('__DAILY_RESET')) && ($_CONFIG['birthday_points'] > 0)) {
195                 // Daily reset was run and we shall pay points so we start checking for members who
196                 // has a birthday for today
197                 $INC_POOL[] = sprintf("%sinc/mails/birthday_mails.php", PATH);
198         }
199         break;
200 }
201
202 // Language file prefix
203 $EXT_LANG_PREFIX = "birthday";
204
205 // Extension is always active?
206 $EXT_ALWAYS_ACTIVE = "N";
207
208 //
209 ?>