e45d7e2b89a7620f0d9c15846d4b08752f3b8031
[mailer.git] / inc / extensions / beg / mode-update.php
1 <?php
2 /************************************************************************
3  * Mailer v0.2.1-FINAL                                Start: 06/25/2013 *
4  * ===================                          Last change: 06/25/2013 *
5  *                                                                      *
6  * -------------------------------------------------------------------- *
7  * File              : mode-update.php                                  *
8  * -------------------------------------------------------------------- *
9  * Short description : Update mode for ext-beg                          *
10  * -------------------------------------------------------------------- *
11  * Kurzbeschreibung  : Update-Modus fuer ext-beg                        *
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 - 2013 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 // @TODO Remove double tabs from all lines
44                 switch (getCurrentExtensionVersion()) {
45                         case '0.0.1': // SQL queries for v0.0.1
46                                 // Update notes (these will be set as task text!)
47                                 setExtensionUpdateNotes("Design &quot;Solid-Business&quot; eingebaut.");
48                                 break;
49
50                         case '0.0.2': // SQL queries for v0.0.2
51                                 // Update notes (these will be set as task text!)
52                                 setExtensionUpdateNotes("Seit <strong>Patch 340</strong> &uuml;berfl&uuml;ssige HTML-Tags entfernt.");
53                                 break;
54
55                         case '0.0.3': // SQL queries for v0.0.3
56                                 addConfigAddSql('beg_points_max', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.10000');
57
58                                 // Update notes (these will be set as task text!)
59                                 setExtensionUpdateNotes("Maximale Obergrenze an {?POINTS?} einstellbar (Standard: 0,1 {?POINTS?})");
60                                 break;
61
62                         case '0.0.4': // SQL queries for v0.0.4
63                                 // Update notes (these will be set as task text!)
64                                 setExtensionUpdateNotes("&Uuml;berlange Kommastellen bei Punktangaben aus Bettellink und Gastbereich entfernt und Admin-Templates repariert (&quot;Unbekannte Spalte <u>beg_points_ma</u>&quot;).");
65                                 break;
66
67                         case '0.0.5': // SQL queries for v0.0.5
68                                 // Update notes (these will be set as task text!)
69                                 setExtensionUpdateNotes("Im Mitgliedsmen&uuml; wurde die Beschreibung aus dem Gastmen&uuml; verwendet.");
70                                 break;
71
72                         case '0.0.6': // SQL queries for v0.0.6
73                                 addConfigAddSql('beg_userid', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
74
75                                 // Update notes (these will be set as task text!)
76                                 setExtensionUpdateNotes("Ein Mitgliedsaccount (empfehlenswert ist Ihr eigenes!) kann zum Abbuchen der {?POINTS?} verwendet werden. Template <u>admin_config_beg.tpl</u> (und pro!) nicht vergessen, zu aktualisieren.");
77                                 break;
78
79                         case '0.0.8': // SQL queries for v0.0.8
80                                 addConfigAddSql('beg_ip_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800');
81
82                                 // Update notes (these will be set as task text!)
83                                 setExtensionUpdateNotes("Zeitsperre gegen die selbe IP-Nummer hinzugef&uuml;gt.");
84                                 break;
85
86                         case '0.0.9': // SQL queries for v0.0.9
87                                 // Update notes (these will be set as task text!)
88                                 setExtensionUpdateNotes("Bitte verschieben Sie die beg-Templates (Ordner: {?PATH?}/templates/".getLanguage()."/html/) in den neuen Order beg!");
89                                 break;
90
91                         case '0.1.0': // SQL queries for v0.2.1
92                                 // Update notes (these will be set as task text!)
93                                 setExtensionUpdateNotes("Abspeichern von Einstellungen repariert.");
94                                 break;
95
96                         case '0.1.1': // SQL queries for v0.1.1
97                                 // Update notes (these will be set as task text!)
98                                 setExtensionUpdateNotes("Vorbereitung auf die neue Mediendaten v0.0.4.");
99                                 break;
100
101                         case '0.1.2':
102                                 // SQL queries for v0.1.2
103                                 addConfigAddSql('beg_ranks', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 10');
104                                 addConfigAddSql('beg_active', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
105                                 addConfigAddSql('beg_rallye', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
106                                 addExtensionAddTableColumnSql('user_data', 'beg_points', 'FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000');
107
108                                 // Menu system
109                                 addAdminMenuSql('user', 'list_beg', 'Bettel-Rallye', 'Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.', 12);
110
111                                 // Update notes (these will be set as task text!)
112                                 setExtensionUpdateNotes("Optionale Bettel-Rallye m&ouml;glich. Und die erbettelten {?POINTS?} k&ouml;nnen entweder nur dem bettelndem Mitglied direkt oder auch seinem Werber gutgeschrieben werden k&ouml;nnen.");
113                                 break;
114
115                         case '0.1.3': // SQL queries for v0.1.3
116                                 // Update notes (these will be set as task text!)
117                                 setExtensionUpdateNotes("Erbettelte {?POINTS?} werden nach Deaktivierung der Bettel-Rallye gel&ouml;scht.");
118                                 break;
119
120                         case '0.1.4': // SQL queries for v0.1.4
121                                 // Update notes (these will be set as task text!)
122                                 setExtensionUpdateNotes("Rechtlichen Hinweis im Mitgliedsbereich vergessen (<strong>member_list_beg.tpl</strong>); Template <strong>member_beg_404.tpl</strong> fehlte!");
123                                 break;
124
125                         case '0.1.5': // SQL queries for v0.1.5
126                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Bettellink/-rallye', descr='IP-Sperre, {OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Verg&uuml;tung und auch die Bettel-Rallye k&ouml;nnen Sie hier einstellen.' WHERE `what`='config_beg' LIMIT 1");
127
128                                 // Update notes (these will be set as task text!)
129                                 setExtensionUpdateNotes("Fehlendes Template im Admin-Bereich hinzugef&uuml;gt. Im Admin-Bereich Hinweis hinzugef&uuml;gt, wenn Bettel-Rallye inaktiv ist. Bitte Script inc/monthly_beg.php l&ouml;schen!");
130                                 break;
131
132                         case '0.1.6': // SQL queries for v0.1.6
133                                 // Update notes (these will be set as task text!)
134                                 setExtensionUpdateNotes("Es wurden immer dem ersten bettelndem Mitglied die {?POINTS?} gutgeschrieben.");
135                                 break;
136
137                         case '0.1.7': // SQL queries for v0.1.7
138                                 addConfigAddSql('beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
139                                 addConfigAddSql('beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
140                                 addConfigAddSql('beg_new_member_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
141                                 addConfigAddSql('beg_notify_bonus', 'FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000');
142                                 addConfigAddSql('beg_notify_wait', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 30');
143                                 addExtensionAddTableColumnSql('user_data', 'beg_ral_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
144                                 addExtensionAddTableColumnSql('user_data', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
145                                 addExtensionAddTableColumnSql('user_data', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
146
147                                 // Update notes (these will be set as task text!)
148                                 setExtensionUpdateNotes("Die Mitglieder k&ouml;nnen nun optional automatisch &uuml;ber eine aktivierte und/oder deaktivierte Bettel-Rallye informiert werden. Beide Benachrichtigungen k&ouml;nnen Sie unter <strong>Einstellungen --&gt; Bettel-Link/-rallye</strong> seperat ein- und ausschalten! Zudem ist eine Sperre gegen eingeloggte Mitglieder eingebaut, die das Klicken auf den eigenen Bettel-Link etwas erschweren soll.");
149                                 break;
150
151                         case '0.1.8': // SQL queries for v0.1.8
152                                 // Update notes (these will be set as task text!)
153                                 setExtensionUpdateNotes("Fehler im t&auml;glichen Reset beseitigt.");
154                                 break;
155
156                         case '0.1.9': // SQL queries for v0.1.9
157                                 // Update notes (these will be set as task text!)
158                                 setExtensionUpdateNotes("De-/Aktivieren des mit dieser Erweiterung verkn&uuml;pften Modules eingebunden.");
159                                 break;
160
161                         case '0.2.0': // SQL queries for v0.2.0
162                                 // Update notes (these will be set as task text!)
163                                 setExtensionUpdateNotes("Bei {?POINTS?}-Gleichstand wird als n&auml;chstes nach wer als letztes Online war umsortiert.");
164                                 break;
165
166                         case '0.2.1': // SQL queries for v0.2.1
167                                 // Update notes (these will be set as task text!)
168                                 setExtensionUpdateNotes("Fehler <strong>unknown column &#39;userid&#39;</strong> beseitigt.");
169                                 break;
170
171                         case '0.2.2': // SQL queries for v0.2.2
172                                 addConfigAddSql('beg_include_own', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
173
174                                 // Update notes (these will be set as task text!)
175                                 setExtensionUpdateNotes("Eigene Mitglieds-Ids sind von der Bettel-Rallye nun ausschliessbar.");
176                                 break;
177
178                         case '0.2.3': // SQL queries for v0.2.3
179                                 // Update notes (these will be set as task text!)
180                                 setExtensionUpdateNotes("Abfrage des Account-Status eingebaut. Es k&ouml;nnen nur best&auml;tigte Accounts betteln.");
181                                 break;
182
183                         case '0.2.4': // SQL queries for v0.2.4
184                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='extras',`sort`=1 WHERE `what`='beg' LIMIT 1");
185
186                                 // Update notes (these will be set as task text!)
187                                 setExtensionUpdateNotes("Mitgliedsmen&uuml; komplett umgebaut.");
188                                 break;
189
190                         case '0.2.5': // SQL queries for v0.2.5
191                                 // Update notes (these will be set as task text!)
192                                 setExtensionUpdateNotes("Fehlerhinweis bei deaktivierter Erweiterung verbessert.");
193                                 break;
194
195                         case '0.2.6': // SQL queries for v0.2.6
196                                 addExtensionAddTableColumnSql('beg_ips', 'sid', "VARCHAR(255) NOT NULL DEFAULT ''");
197                                 addConfigAddSql('beg_pay_mode', "ENUM('IMG','JS','BOTH','NONE') DEFAULT 'NONE' NOT NULL ;");
198
199                                 // Update notes (these will be set as task text!)
200                                 setExtensionUpdateNotes("IP-Lock mit Session-Id erweitert. Tracker-Script eingef&uuml;gt, dass das Einbinden des Bettel-Links als Bild/Script/CSS verhindern soll.");
201                                 break;
202
203                         case '0.2.7': // SQL queries for v0.2.7
204                                 addConfigChangeSql('beg_ral_en_notify', 'beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
205                                 addConfigChangeSql('beg_ral_di_notify', 'beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
206                                 addConfigChangeSql('beg_new_mem_notify', 'beg_new_member_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
207                                 addExtensionChangeTableColumnSql('user_data', 'beg_ral_en_notify', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
208                                 addExtensionChangeTableColumnSql('user_data', 'beg_ral_di_notify', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
209
210                                 // Update notes (these will be set as task text!)
211                                 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
212                                 break;
213
214                         case '0.2.8': // SQL queries for v0.2.8
215                                 addConfigChangeSql('beg_ral_enable_notify', 'beg_rallye_enable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
216                                 addConfigChangeSql('beg_ral_disable_notify', 'beg_rallye_disable_notify', "ENUM('Y','N') NOT NULL DEFAULT 'N'");
217                                 addExtensionChangeTableColumnSql('user_data', 'beg_ral_enable_notify', 'beg_rallye_enable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
218                                 addExtensionChangeTableColumnSql('user_data', 'beg_ral_disable_notify', 'beg_rallye_disable_notify', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 0');
219
220                                 // Update notes (these will be set as task text!)
221                                 setExtensionUpdateNotes("Umbenannt nach neuer Namenskonvention");
222                                 break;
223
224                         case '0.2.9': // SQL queries for v0.2.9
225                                 addDropTableSql('beg_referrals');
226                                 addCreateTableSql('beg_referrals', "
227 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
228 `userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
229 `remote_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
230 `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
231 `referral_url` TINYTEXT NOT NULL,
232 PRIMARY KEY (`id`),
233 INDEX (`userid`)",
234                                         'Recorded referral URLs');
235
236                                 // Add admin menu
237                                 addAdminMenuSql('user','list_beg_referral_urls','Bettel-Referrals auflisten','Listet alle Bettellink-Aufrufe inklusive Referral-URL auf.','13');
238
239                                 // Update notes (these will be set as task text!)
240                                 setExtensionUpdateNotes("Loggen der Referral-URLs hinzugef&uuml;gt.");
241                                 break;
242
243                         case '0.3.0': // SQL queries for v0.3.0
244                                 addConfigDropSql('beg_mode');
245
246                                 // Register points data
247                                 registerExtensionPointsData('beg'        , 'points', 'LOCKED', 'DIRECT');
248                                 registerExtensionPointsData('monthly_beg', 'points', 'LOCKED', 'DIRECT');
249
250                                 // Update notes
251                                 setExtensionUpdateNotes("Monatliche Bettelrallye und die erbettelten {?POINTS?} werden nun &uuml;ber die Tabelle <strong>{OPEN_CONFIG}_MYSQL_PREFIX{CLOSE_CONFIG}_points_data</strong> verwaltet.");
252                                 break;
253
254                         case '0.3.1': // SQL queries for v0.3.1
255                                 // Add/move menu
256                                 addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='beg2'");
257                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `action`='members',`sort`=3 WHERE `what`='beg' LIMIT 1");
258                                 addMemberMenuSql('rals', 'beg2', 'Bettel-Rallye', 3);
259
260                                 // Update notes
261                                 setExtensionUpdateNotes("Bettel-Rallye re-hinzugef&uuml;gt.");
262                                 break;
263
264                         case '0.3.2': // SQL queries for v0.3.2
265                                 // Add module entry
266                                 addModuleSql('beg', '{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}', 'Y', 'Y', 'N', 'N');
267
268                                 // Set module title
269                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='Betteln bei {OPEN_CONFIG}MAIN_TITLE{CLOSE_CONFIG}' WHERE `module`='beg' AND `title`='' LIMIT 1");
270
271                                 // Update notes
272                                 setExtensionUpdateNotes("Modul registriert und bei leerem Titel mit einem Standardtitel versehen.");
273                                 break;
274
275                         case '0.3.3': // SQL queries for v0.3.3
276                                 // Register a filter
277                                 registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'BEG_RALLYE_USER_REGISTRATION_ADD_SQL_COLUMNS', FALSE, TRUE, isExtensionDryRun());
278                                 registerFilter(__FILE__, __LINE__, 'init', 'BEG_PURGE_IPS_NOTIFY_USER', FALSE, TRUE, isExtensionDryRun());
279
280                                 // This depends on ext-register
281                                 addExtensionDependency('register');
282
283                                 // Update notes
284                                 setExtensionUpdateNotes("Filter f&uuml;r Anmeldeformular und Aufr&auml;men der IPs hinzugef&uuml;gt.");
285                                 break;
286
287                         case '0.3.4': // SQL queries for v0.3.4
288                                 // SQL queries (renaming)
289                                 addRenameTableSql('beg_referrals', 'referrals');
290                                 addExtensionChangeTableColumnSql('beg_referrals', 'referal_url', 'referral_url', 'TINYTEXT NOT NULL');
291                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `what`='list_beg_referral_urls' WHERE `what`='list_beg_referal_urls' LIMIT 1");
292
293                                 // Update notes
294                                 setExtensionUpdateNotes("Verwendungszwecke f&uuml;r Referralgutgschriften registriert.");
295                                 break;
296
297                         case '0.3.5': // SQL queries for v0.3.5
298                                 // Register a filter
299                                 registerFilter(__FILE__, __LINE__, 'config_userid_exclusion_sql', 'EXCLUDE_BEG_USERID', FALSE, TRUE, isExtensionDryRun());
300
301                                 // Update notes
302                                 setExtensionUpdateNotes("Filter f&uuml;r das Ausschlie&szlig;en des konfigurierbaren Mitgliedaccounts hinzugef&uuml;gt.");
303                                 break;
304
305                         case '0.3.6': // SQL queries for v0.3.6
306                                 // SQL to update module
307                                 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_mod_reg` SET `title`='{OPEN_LANGUAGE}MODULE_BEG_TITLE{CLOSE_LANGUAGE}' WHERE `module`='beg' LIMIT 1");
308
309                                 // Update notes
310                                 setExtensionUpdateNotes("Modul-Titel nach neuem Format angepasst.");
311                                 break;
312                 } // END - switch
313
314 // [EOF]
315 ?>