]> git.mxchange.org Git - mailer.git/blob - 0.2.1/inc/extensions/ext-birthday.php
(no commit message)
[mailer.git] / 0.2.1 / inc / extensions / ext-birthday.php
1 <?php\r
2 /************************************************************************\r
3  * MXChange v0.2.1                                    Start: 05/23/2004 *\r
4  * ================                             Last change: 06/26/2004 *\r
5  *                                                                      *\r
6  * -------------------------------------------------------------------- *\r
7  * File              : ext-birthday.php                                 *\r
8  * -------------------------------------------------------------------- *\r
9  * Short description : Sends out happy-birthday mails                   *\r
10  * -------------------------------------------------------------------- *\r
11  * Kurzbeschreibung  : Versendet Geburtstagsmails an die Mitglieder     *\r
12  * -------------------------------------------------------------------- *\r
13  *                                                                      *\r
14  * -------------------------------------------------------------------- *\r
15  * Copyright (c) 2003 - 2007 by Roland Haeder                           *\r
16  * For more information visit: http://www.mxchange.org                  *\r
17  *                                                                      *\r
18  * This program is free software; you can redistribute it and/or modify *\r
19  * it under the terms of the GNU General Public License as published by *\r
20  * the Free Software Foundation; either version 2 of the License, or    *\r
21  * (at your option) any later version.                                  *\r
22  *                                                                      *\r
23  * This program is distributed in the hope that it will be useful,      *\r
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of       *\r
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        *\r
26  * GNU General Public License for more details.                         *\r
27  *                                                                      *\r
28  * You should have received a copy of the GNU General Public License    *\r
29  * along with this program; if not, write to the Free Software          *\r
30  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston,               *\r
31  * MA  02110-1301  USA                                                  *\r
32  ************************************************************************/\r
33 \r
34 // Some security stuff...\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))\r
36 {\r
37         $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";\r
38         require($INC);\r
39 }\r
40 \r
41 // Version number\r
42 $EXT_VERSION = "0.3.8";\r
43 \r
44 // Auto-set extension version\r
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;\r
46 \r
47 // Version history array (add more with , "0.1" and so on)\r
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");\r
49 \r
50 switch ($EXT_LOAD_MODE)\r
51 {\r
52 case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)\r
53         // SQL commands to run\r
54         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD birthday_sent varchar(10) NOT NULL default '0'";\r
55         break;\r
56 \r
57 case "remove": // Do stuff when removing extension\r
58         // SQL commands to run\r
59         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data DROP birthday_sent";\r
60         $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP birthday_points";\r
61         $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_birthday";\r
62         $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_birthday' LIMIT 1";\r
63         break;\r
64 \r
65 case "activate": // Do stuff when admin activates this extension\r
66         // SQL commands to run\r
67         $SQLs[] = "";\r
68         break;\r
69 \r
70 case "deactivate": // Do stuff when admin deactivates this extension\r
71         // SQL commands to run\r
72         $SQLs[] = "";\r
73         break;\r
74 \r
75 case "update": // Update an extension\r
76         switch ($EXT_VER)\r
77         {\r
78         case "0.1": // SQL queries for v0.1\r
79                 // Update notes (these will be set as task text!)\r
80                 $UPDATE_NOTES = "Wenn t&auiml;glicher Reset war, wird eine ben&ouml;tigte Include-Datei nicht mehr von daily-reset.php eingebunden, sondern von der Erweiterungsdatei selber.";\r
81                 break;\r
82 \r
83         case "0.2": // SQL queries for v0.2\r
84                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_points bigint(20) not null default '0'";\r
85                 $SQLs[] = "DROP TABLE IF EXISTS "._MYSQL_PREFIX."_user_birthday";\r
86                 $SQLs[] = "CREATE TABLE "._MYSQL_PREFIX."_user_birthday (\r
87 id bigint(20) not null auto_increment,\r
88 userid bigint(20) not null default '0',\r
89 points bigint(20) not null default '0',\r
90 chk_value varchar(255) not null default '',\r
91 KEY(userid),\r
92 PRIMARY KEY(id)\r
93 ) Type=MyISAM";\r
94                 $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)";\r
95 \r
96                 // Update notes (these will be set as task text!)\r
97                 $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.";\r
98                 break;\r
99 \r
100         case "0.2.1": // SQL queries for v0.2.1\r
101                 // Update notes (these will be set as task text!)\r
102                 $UPDATE_NOTES = "Abstand zwischen ausgesendeter Geburtstagsmails auf 364 Tage erh&ouml;ht.";\r
103                 break;\r
104 \r
105         case "0.2.4": // SQL queries for v0.2.4\r
106                 // Update notes (these will be set as task text!)\r
107                 $UPDATE_NOTES = "Laden der birthday_mails.php &quot;intelligenter&quot; per Datenfeld und Lade-Schleife in load_extensions.php realisiert.";\r
108                 break;\r
109 \r
110         case "0.2.5": // SQL queries for v0.2.5\r
111                 // Update notes (these will be set as task text!)\r
112                 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";\r
113                 break;\r
114 \r
115         case "0.2.6": // SQL queries for v0.2.6\r
116                 // Update notes (these will be set as task text!)\r
117                 $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";\r
118                 break;\r
119 \r
120         case "0.2.7": // SQL queries for v0.2.7\r
121                 // Update notes (these will be set as task text!)\r
122                 $UPDATE_NOTES = "Sicherheitsupdate am Script <U>birtday_confirm.php</U> durchgef&uuml;hrt.";\r
123                 break;\r
124 \r
125         case "0.2.8": // SQL queries for v0.2.8\r
126                 // Update notes (these will be set as task text!)\r
127                 $UPDATE_NOTES = "Vergessenes _OB_CACHING gesetzt.";\r
128                 break;\r
129 \r
130         case "0.2.9": // SQL queries for v0.2.9\r
131                 // Update notes (these will be set as task text!)\r
132                 $UPDATE_NOTES = "Seit <A href=\"".SERVER_URL."/patches/340-Gast_Mitgliedsmenue_Deaktivieren.zip\">Patch 340</A> &uuml;berfl&uuml;ssige HTML-Tags entfernt.";\r
133                 break;\r
134 \r
135         case "0.3.0": // SQL queries for v0.3.0\r
136                 // Update notes (these will be set as task text!)\r
137                 $UPDATE_NOTES = "Ausgabe des generierten HTML-Codes nach <U>inc/footer.php</U> verlagert.";\r
138                 break;\r
139 \r
140         case "0.3.1": // SQL queries for v0.3.1\r
141                 // Update notes (these will be set as task text!)\r
142                 $UPDATE_NOTES = "Wort <STRONG>Punkte</STRONG> dynamisiert.";\r
143                 break;\r
144 \r
145         case "0.3.2": // SQL queries for v0.3.2\r
146                 // Update notes (these will be set as task text!)\r
147                 $UPDATE_NOTES = "Sicherheitsupdate: SQL-Anweisungen gesch&uuml;tzt.";\r
148                 break;\r
149 \r
150         case "0.3.3": // SQL queries for v0.3.3\r
151                 // Update notes (these will be set as task text!)\r
152                 $UPDATE_NOTES = "Bitte verschieben Sie die birthday-Templates (Ordner: ".PATH."/templates/".GET_LANGUAGE()."/html/) in den neuen Order birthday!";\r
153                 break;\r
154 \r
155         case "0.3.4": // SQL queries for v0.3.4\r
156                 // Update notes (these will be set as task text!)\r
157                 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";\r
158                 break;\r
159 \r
160         case "0.3.5": // SQL queries for v0.3.5\r
161                 // Update notes (these will be set as task text!)\r
162                 $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";\r
163                 break;\r
164 \r
165         case "0.3.6": // SQL queries for v0.3.6\r
166                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_mode enum('DIRECT', 'REF') not null default 'DIRECT'";\r
167                 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD birthday_active enum('Y', 'N') not null default 'N'";\r
168 \r
169                 // Update notes (these will be set as task text!)\r
170                 $UPDATE_NOTES = "Verg&uuml;tungsmodus des Geburtstagsbonus einstellbar.";\r
171                 break;\r
172 \r
173         case "0.3.7": // SQL queries for v0.3.7\r
174                 // Update notes (these will be set as task text!)\r
175                 $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.";\r
176                 break;\r
177 \r
178         case "0.3.8": // SQL queries for v0.3.8\r
179                 // Update notes (these will be set as task text!)\r
180                 $UPDATE_NOTES = "Hash-Erstellung von <STRONG>md5()</STRONG> auf bessere Funktion <STRONG>generateHash()</STRONG> umgestellt.";\r
181                 break;\r
182         }\r
183         break;\r
184 \r
185 default: // Do stuff when extension is loaded\r
186         $DUMMY = LOAD_CONFIG("0");\r
187 \r
188         // Copy config to main array\r
189         $CONFIG['birthday_points'] = $DUMMY['birthday_points'];\r
190         $CONFIG['birthday_mode']   = $DUMMY['birthday_mode'];\r
191         $CONFIG['birthday_active'] = $DUMMY['birthday_active'];\r
192 \r
193         // Save some RAM...\r
194         unset($DUMMY);\r
195 \r
196         if ((defined('__DAILY_RESET')) && ($CONFIG['birthday_points'] > 0))\r
197         {\r
198                 // Daily reset was run and we shall pay points so we start checking for members who\r
199                 // has a birthday for today\r
200                 $INC_POOL[] = PATH."inc/mails/birthday_mails.php";\r
201         }\r
202         break;\r
203 }\r
204 \r
205 // Language file prefix\r
206 $EXT_LANG_PREFIX = "birthday";\r
207 \r
208 // Extension is always active?\r
209 $EXT_ALWAYS_ACTIVE = "N";\r
210 \r
211 //\r
212 ?>\r