2 /************************************************************************
\r
3 * MXChange v0.2.1 Start: 04/29/2004 *
\r
4 * ================ Last change: 11/14/2004 *
\r
6 * -------------------------------------------------------------------- *
\r
7 * File : ext-order.php *
\r
8 * -------------------------------------------------------------------- *
\r
9 * Short description : Swapped out order system for PRO version *
\r
10 * -------------------------------------------------------------------- *
\r
11 * Kurzbeschreibung : Ausgelagertes Buchungssytem fuer PRO-Version *
\r
12 * -------------------------------------------------------------------- *
\r
14 * -------------------------------------------------------------------- *
\r
15 * Copyright (c) 2003 - 2007 by Roland Haeder *
\r
16 * For more information visit: http://www.mxchange.org *
\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
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
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
34 // Some security stuff...
\r
35 if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF'])))
\r
37 $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4)."/security.php";
\r
42 $EXT_VERSION = "0.4.7";
\r
44 // Auto-set extension version
\r
45 if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
\r
47 // Version history array (add more with , "0.1" and so on)
\r
48 $EXT_VER_HISTORY = array("0.0", "0.1", "0.1.1", "0.1.2", "0.1.3", "0.1.4", "0.1.5", "0.1.6", "0.1.7", "0.1.8", "0.1.9", "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", "0.4.0", "0.4.1", "0.4.2", "0.4.3", "0.4.4", "0.4.5", "0.4.6", "0.4.7");
\r
50 switch ($EXT_LOAD_MODE)
\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
57 case "remove": // Do stuff when removing extension
\r
58 // SQL commands to run
\r
59 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config DROP order_max_full";
\r
60 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
\r
63 case "activate": // Do stuff when admin activates this extension
\r
64 // SQL commands to run
\r
65 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='Y', locked='N' WHERE what='order' LIMIT 1";
\r
66 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='order' LIMIT 1";
\r
69 case "deactivate": // Do stuff when admin deactivates this extension
\r
70 // SQL commands to run
\r
71 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET visible='N', locked='Y' WHERE what='order' LIMIT 1";
\r
72 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_mod_reg SET locked='Y' WHERE module='order' LIMIT 1";
\r
75 case "update": // Update an extension
\r
78 case "0.1": // SQL queries for v0.1
\r
79 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_max_full enum('ORDER', 'MAX') not null default 'MAX'";
\r
80 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('setup', 'config_order', 'Mailbuchungsseite', '7', 'Einstellungen am Mailbuchungsformular.')";
\r
82 // Update notes (these will be set as task text!)
\r
83 $UPDATE_NOTES = "Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig.";
\r
86 case "0.1.1": // SQL queries for v0.1.1
\r
87 $SQLs[] = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_admin_menu WHERE what='config_order' LIMIT 1";
\r
88 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_admin_menu (action, what, title, sort, descr) VALUES ('setup', 'config_order', 'Mailbuchungsseite', '7', 'Einstellungen am Mailbuchungsformular.')";
\r
89 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_user_data ADD mail_orders bigint(20) not null default '0'";
\r
91 // Update notes (these will be set as task text!)
\r
92 $UPDATE_NOTES = "Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber).";
\r
95 case "0.1.3": // SQL queries for v0.1.3
\r
96 // Update notes (these will be set as task text!)
\r
97 $UPDATE_NOTES = "Maximale Mailbuchungen repariert (werden nun hochgezählt und bei täglichem Reset auf 0 gesetzt).";
\r
100 case "0.1.4": // SQL queries for v0.1.4
\r
101 // Update notes (these will be set as task text!)
\r
102 $UPDATE_NOTES = "Dummy-Datenfeld wird wieder gelöscht, um Probleme zu vermeiden. Fehlende Spalte <I>mail_order</I> korregiert auf <I>mail_orders</I>.";
\r
105 case "0.1.5": // SQL queries for v0.1.5
\r
106 // Update notes (these will be set as task text!)
\r
107 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
\r
110 case "0.1.6": // SQL queries for v0.1.6
\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
115 case "0.1.7": // SQL queries for v0.1.7
\r
116 // Update notes (these will be set as task text!)
\r
117 $UPDATE_NOTES = "Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist.";
\r
120 case "0.1.8": // SQL queries for v0.1.8
\r
121 // Update notes (these will be set as task text!)
\r
122 $UPDATE_NOTES = "Problem mit Speicherung der Einstellungen beseitigt.";
\r
125 case "0.1.9": // SQL queries for v0.1.9
\r
126 // Update notes (these will be set as task text!)
\r
127 $UPDATE_NOTES = "Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist.";
\r
130 case "0.2.0": // SQL queries for v0.2.0
\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> überflüssige HTML-Tags entfernt.";
\r
135 case "0.2.1": // SQL queries for v0.2.1
\r
136 // Update notes (these will be set as task text!)
\r
137 $UPDATE_NOTES = "Templates <U>member_frameset-back.tpl</U> und <U>member_frameset-send.tpl</U> nach <U>member_order_back.tpl</U> und <U>member_order_send.tpl</U> umbenannt.";
\r
140 case "0.2.2": // SQL queries for v0.2.2
\r
141 // Update notes (these will be set as task text!)
\r
142 $UPDATE_NOTES = "Es wird nun überprüft ob auch genügend Empfänger eingegeben worden sind und ob auch genügend empfangsbereit sind.";
\r
145 case "0.2.3": // SQL queries for v0.2.3
\r
146 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_min bigint(20) not null default '10'";
\r
148 // Update notes (these will be set as task text!)
\r
149 $UPDATE_NOTES = "Minimum an Empfänger pro Mailbuchung einstellbar. Standart: 10 Empfänger";
\r
152 case "0.2.4": // SQL queries for v0.2.4
\r
153 // Update notes (these will be set as task text!)
\r
154 $UPDATE_NOTES = "Anzahl mindestens einszustellende Empfänger wird nun auch angezeigt.";
\r
157 case "0.2.5": // SQL queries for v0.2.5
\r
158 // Update notes (these will be set as task text!)
\r
159 $UPDATE_NOTES = "Speicherung der Einstellungen klappt.";
\r
162 case "0.2.6": // SQL queries for v0.2.6
\r
163 // Update notes (these will be set as task text!)
\r
164 $UPDATE_NOTES = "Fehler in Mailbuchung behoben: Es wurde beim Ermitteln der nötigen {!POINTS!} die maximale Anzahl von Usern in der Kategorie gewählt und
\r
165 nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der User hätte nicht genügend {!POINTS!} auf dem Konto. Ein Rechenbeispiel:
\r
167 <LI>Das Mitglied wählt eine Kategorie XYZ mit maximal 15 Empfängern aus.</LI>
\r
168 <LI>Es stellt die Mailart <U>"3 {!POINTS!} Kosten / Mail"</U> ein.</LI>
\r
169 <LI>Es hat aber nur {!POINTS!} für 10 Empfänger und gibt 10 ein.</LI>
\r
170 <LI>Das Script hatte bis zu dieser Version 3 {!POINTS!} * <U>15</U> = 45 {!POINTS!} gerechnet, hat das Mitglied mehr oder gleich 45 {!POINTS!}, fiehl dieser Fehler nicht
\r
172 <LI>Hatte es aber, wie hier im Beispiel 31 {!POINTS!}, konnte es nicht mehr buchen.</LI>
\r
173 <LI>Jetzt ist der Fehler endlich weg! Machen Sie dies bitte Ihren Mitgliedern bekannt.</LI>
\r
177 case "0.2.7": // SQL queries for v0.2.7
\r
178 // Update notes (these will be set as task text!)
\r
179 $UPDATE_NOTES = "Fehler mit <U>__MIN_VALUE</U> behoben.";
\r
182 case "0.2.8": // SQL queries for v0.2.8
\r
183 // Update notes (these will be set as task text!)
\r
184 $UPDATE_NOTES = "Konstantenproblem beseitigt.";
\r
187 case "0.2.9": // SQL queries for v0.2.9
\r
188 // Update notes (these will be set as task text!)
\r
189 $UPDATE_NOTES = "Problem mit nicht funktionierenden Mailbuchungen beseitigt.";
\r
192 case "0.3.0": // SQL queries for v0.3.0
\r
193 // Update notes (these will be set as task text!)
\r
194 $UPDATE_NOTES = "Basis-Modul <STRONG>order.php</STRONG> abgesichert, wenn Erweiterung nicht aktiviert ist.";
\r
197 case "0.3.1": // SQL queries for v0.3.1
\r
198 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_select varchar(255) not null default 'userid'";
\r
199 $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD order_mode enum('ASC', 'DESC') not null default 'DESC'";
\r
201 // Update notes (these will be set as task text!)
\r
202 $UPDATE_NOTES = "Beworbene URL wird nun getestet.";
\r
205 case "0.3.2": // SQL queries for v0.3.2
\r
206 // Update notes (these will be set as task text!)
\r
207 $UPDATE_NOTES = "Datumsformat festgelegt auf ausführlich.";
\r
210 case "0.3.3": // SQL queries for v0.3.3
\r
211 // Update notes (these will be set as task text!)
\r
212 $UPDATE_NOTES = "Unter <STRONG>Einstellungen - Mailbuchungsseite</STRONG> war immer die Tabellenspalte <STRONG>Mitgliedsnummer</STRONG> ausgewählt.";
\r
215 case "0.3.4": // SQL queries for v0.3.4
\r
216 // Update notes (these will be set as task text!)
\r
217 $UPDATE_NOTES = "Dateiamenskonflikt zwischen den Erweiterungen <STRONG>support</STRONG> und <STRONG>order</STRONG> behoben.";
\r
220 case "0.3.5": // SQL queries for v0.3.5
\r
221 // Update notes (these will be set as task text!)
\r
222 $UPDATE_NOTES = "Das Mitglied konnte geziehlt die Anzahl Mailbuchungen durch Abspeichern seines Profiles beeinflussen. Der Fehler war eine falsche Tabellenspalte. Dies war <STRONG>max_mails</STRONG>, die durch das Mitglieder veränderbar ist und zur Festellung der Maximalen Mailbuchungen herangezogen wurde.";
\r
225 case "0.3.6": // SQL queries for v0.3.6
\r
226 // Update notes (these will be set as task text!)
\r
227 $UPDATE_NOTES = "Im Modul order (<STRONG>inc/modules/order.php</STRONG>) wurde fehlerhafterweise die Erweiterung <STRONG>beg</STRONG> getestet.";
\r
230 case "0.3.7": // SQL queries for v0.3.7
\r
231 // Update notes (these will be set as task text!)
\r
232 $UPDATE_NOTES = "SQL-Anweisungen mit SQL_QUERY_ESC() abgesichert.";
\r
235 case "0.3.8": // SQL queries for v0.3.8
\r
236 // Update notes (these will be set as task text!)
\r
237 $UPDATE_NOTES = "Mailbuchungsseite korregiert.";
\r
240 case "0.3.9": // SQL queries for v0.3.9
\r
241 // Update notes (these will be set as task text!)
\r
242 $UPDATE_NOTES = "Erneuten Fehler in Mailbuchungsseite behoben.";
\r
245 case "0.4.0": // SQL queries for v0.4.0
\r
246 // Update notes (these will be set as task text!)
\r
247 $UPDATE_NOTES = POINTS."-Abzug klappt wieder. Danke an Andreman!";
\r
250 case "0.4.1": // SQL queries for v0.4.1
\r
251 // Update notes (these will be set as task text!)
\r
252 $UPDATE_NOTES = "Abspeichern von Einstellungen repariert.";
\r
255 case "0.4.2": // SQL queries for v0.4.2
\r
256 // Update notes (these will be set as task text!)
\r
257 $UPDATE_NOTES = "Vorbereitung auf die neue Mediendaten v0.0.4.";
\r
260 case "0.4.3": // SQL queries for v0.4.3
\r
261 // Update notes (these will be set as task text!)
\r
262 $UPDATE_NOTES = "Neue Urlaubsschaltung mit integriert.";
\r
265 case "0.4.4": // SQL queries for v0.4.4
\r
266 // Update notes (these will be set as task text!)
\r
267 $UPDATE_NOTES = "Ein <STRONG>WHERE ext_active='Y'</STRONG> tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt.";
\r
270 case "0.4.5": // SQL queries for v0.4.5
\r
271 // Update notes (these will be set as task text!)
\r
272 $UPDATE_NOTES = "De-/Aktivieren des mit dieser Erweiterung verknüpften Modules eingebunden.";
\r
275 case "0.4.6": // SQL queries for v0.4.6
\r
276 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort, visible, locked) VALUES ('order', '', 'Mailbuchungen', 3, 'Y', 'N')";
\r
277 $SQLs[] = "INSERT INTO "._MYSQL_PREFIX."_member_menu (action, what, title, sort, visible, locked) VALUES ('order', 'order2', 'Framekiller-Mails', 2, 'Y', 'N')";
\r
278 $SQLs[] = "UPDATE "._MYSQL_PREFIX."_member_menu SET action='order', sort='1', title='Klick-Mails' WHERE what='order' LIMIT 1";
\r
280 // Update notes (these will be set as task text!)
\r
281 $UPDATE_NOTES = "Mitgliedsmenü komplett umgebaut.";
\r
284 case "0.4.7": // SQL queries for v0.4.7
\r
285 // Update notes (these will be set as task text!)
\r
286 $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert.";
\r
291 default: // Do stuff when extension is loaded
\r
292 $DUMMY = LOAD_CONFIG("0");
\r
293 $CONFIG['order_min'] = $DUMMY['order_min']; // Order at least X mails
\r
294 $CONFIG['order_max'] = $DUMMY['order_max_full']; // Ordering mode: as much as possible or as much as the user want's to receive
\r
295 $CONFIG['order_select'] = $DUMMY['order_select']; // Sorting mode for selecting users while looking some up for mail delivery
\r
296 $CONFIG['order_mode'] = $DUMMY['order_mode']; // Ascending or descending sort order for above
\r
299 // Do daily reset only when installed and extension version is at least 0.1.1
\r
300 if ((defined('__DAILY_RESET')) && (!mxchange_installing) && (mxchange_installed) && (admin_registered) && (GET_EXT_VERSION("order") >= "0.1.1"))
\r
302 // Reset mail order values
\r
303 $result_ext = SQL_QUERY("UPDATE "._MYSQL_PREFIX."_user_data SET mail_orders='0' WHERE mail_orders > 0", __FILE__, __LINE__);
\r
307 // Language file prefix
\r
308 $EXT_LANG_PREFIX = "order";
\r
310 // Extension is always active?
\r
311 $EXT_ALWAYS_ACTIVE = "N";
\r