X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fextensions%2Fext-order.php;h=044217af8bf45bea45bef16017870e9bd8868337;hb=0437f06b273f885db05736449a952c6eb72086ca;hp=9dca71ddcebc4cc70d8dd20e69ccac73fb39f89c;hpb=8a73ce89f88fb09523fce05eb2aff80665e65827;p=mailer.git diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 9dca71ddce..044217af8b 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -38,128 +38,128 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); } // Version number -EXT_SET_VERSION("0.5.0"); +EXT_SET_VERSION('0.5.0'); -// Version history array (add more with , "0.1" and so on) -EXT_SET_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", "0.4.8", "0.4.9", "0.5.0")); +// Version history array (add more with , '0.1.0' and so on) +EXT_SET_VER_HISTORY(array('0.0', '0.1.0', '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', '0.4.8', '0.4.9', '0.5.0')); switch ($EXT_LOAD_MODE) { -case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called) +case 'register': // Do stuff when installation is running (modules.php?module=admin&action=login is called) // SQL commands to run - ADD_SQL(""); + ADD_EXT_SQL(""); break; -case "remove": // Do stuff when removing extension +case 'remove': // Do stuff when removing extension // SQL commands to run - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"); + ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order'"); break; -case "activate": // Do stuff when admin activates this extension +case 'activate': // Do stuff when admin activates this extension // SQL commands to run - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' LIMIT 1"); - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='order' LIMIT 1"); + ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='order' LIMIT 1"); + ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', `hidden`='N', `admin_only`='N', `mem_only`='Y' WHERE `module`='order' LIMIT 1"); break; -case "deactivate": // Do stuff when admin deactivates this extension +case 'deactivate': // Do stuff when admin deactivates this extension // SQL commands to run - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='order' LIMIT 1"); - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `visible`='N', `locked`='Y' WHERE module='order' LIMIT 1"); + ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='order' LIMIT 1"); + ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `visible`='N', `locked`='Y' WHERE `module`='order' LIMIT 1"); break; -case "update": // Update an extension +case 'update': // Update an extension switch ($EXT_VER) { - case "0.1": // SQL queries for v0.1 - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); + case '0.1.0': // SQL queries for v0.1 + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_max_full ENUM('ORDER','MAX') NOT NULL DEFAULT 'MAX'"); + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Maximale Mailbuchungen sind nun vom maximalen Empfang abhägig."); break; - case "0.1.1": // SQL queries for v0.1.1 - ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + case '0.1.1': // SQL queries for v0.1.1 + ADD_EXT_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `what`='config_order' LIMIT 1"); + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`sort`,`descr`) VALUES ('setup','config_order','Mailbuchungsseite','7','Einstellungen am Mailbuchungsformular.')"); + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber)."); break; - case "0.1.3": // SQL queries for v0.1.3 + case '0.1.3': // SQL queries for v0.1.3 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Maximale Mailbuchungen repariert (werden nun hochgezählt und bei täglichem Reset auf 0 gesetzt)."); break; - case "0.1.4": // SQL queries for v0.1.4 + case '0.1.4': // SQL queries for v0.1.4 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Dummy-Datenfeld wird wieder gelöscht, um Probleme zu vermeiden. Fehlende Spalte mail_order korregiert auf mail_orders."); break; - case "0.1.5": // SQL queries for v0.1.5 + case '0.1.5': // SQL queries for v0.1.5 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."); break; - case "0.1.6": // SQL queries for v0.1.6 + case '0.1.6': // SQL queries for v0.1.6 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."); break; - case "0.1.7": // SQL queries for v0.1.7 + case '0.1.7': // SQL queries for v0.1.7 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Fehler beseitigt, wenn error_reporting=E_ALL gesetzt ist."); break; - case "0.1.8": // SQL queries for v0.1.8 + case '0.1.8': // SQL queries for v0.1.8 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Problem mit Speicherung der Einstellungen beseitigt."); break; - case "0.1.9": // SQL queries for v0.1.9 + case '0.1.9': // SQL queries for v0.1.9 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Menüpunkte im Gast-/Mitgliedsbereich können nicht mehr aufgerufen werden, wenn die Erweiterung deaktiviert ist."); break; - case "0.2.0": // SQL queries for v0.2.0 + case '0.2.0': // SQL queries for v0.2.0 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Seit Patch 340 überflüssige HTML-Tags entfernt."); break; - case "0.2.1": // SQL queries for v0.2.1 + case '0.2.1': // SQL queries for v0.2.1 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Templates member_frameset-back.tpl und member_frameset-send.tpl nach member_order_back.tpl und member_order_send.tpl umbenannt."); break; - case "0.2.2": // SQL queries for v0.2.2 + case '0.2.2': // SQL queries for v0.2.2 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Es wird nun überprüft ob auch genügend Empfänger eingegeben worden sind und ob auch genügend empfangsbereit sind."); break; - case "0.2.3": // SQL queries for v0.2.3 - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_min BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"); + case '0.2.3': // SQL queries for v0.2.3 + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_min BIGINT(20) UNSIGNED NOT NULL DEFAULT 10"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Minimum an Empfänger pro Mailbuchung einstellbar. Standart: 10 Empfänger"); break; - case "0.2.4": // SQL queries for v0.2.4 + case '0.2.4': // SQL queries for v0.2.4 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Anzahl mindestens einszustellende Empfänger wird nun auch angezeigt."); break; - case "0.2.5": // SQL queries for v0.2.5 + case '0.2.5': // SQL queries for v0.2.5 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Speicherung der Einstellungen klappt."); break; - case "0.2.6": // SQL queries for v0.2.6 + case '0.2.6': // SQL queries for v0.2.6 // Update notes (these will be set as task text!) EXT_SET_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 nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der User hätte nicht genügend {!POINTS!} auf dem Konto. Ein Rechenbeispiel: @@ -174,135 +174,135 @@ nicht die vom Mitglied eingegebene. Resultat: Das Script beschwerte sich, der Us "); break; - case "0.2.7": // SQL queries for v0.2.7 + case '0.2.7': // SQL queries for v0.2.7 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Fehler mit __MIN_VALUE behoben."); break; - case "0.2.8": // SQL queries for v0.2.8 + case '0.2.8': // SQL queries for v0.2.8 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Konstantenproblem beseitigt."); break; - case "0.2.9": // SQL queries for v0.2.9 + case '0.2.9': // SQL queries for v0.2.9 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Problem mit nicht funktionierenden Mailbuchungen beseitigt."); break; - case "0.3.0": // SQL queries for v0.3.0 + case '0.3.0': // SQL queries for v0.3.0 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Basis-Modul order.php abgesichert, wenn Erweiterung nicht aktiviert ist."); break; - case "0.3.1": // SQL queries for v0.3.1 - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_select VARCHAR(255) NOT NULL DEFAULT 'userid'"); - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_mode ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'"); + case '0.3.1': // SQL queries for v0.3.1 + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_select VARCHAR(255) NOT NULL DEFAULT 'userid'"); + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD order_mode ENUM('ASC','DESC') NOT NULL DEFAULT 'DESC'"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Beworbene URL wird nun getestet."); break; - case "0.3.2": // SQL queries for v0.3.2 + case '0.3.2': // SQL queries for v0.3.2 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Datumsformat festgelegt auf ausführlich."); break; - case "0.3.3": // SQL queries for v0.3.3 + case '0.3.3': // SQL queries for v0.3.3 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Unter Einstellungen - Mailbuchungsseite war immer die Tabellenspalte Mitgliedsnummer ausgewählt."); break; - case "0.3.4": // SQL queries for v0.3.4 + case '0.3.4': // SQL queries for v0.3.4 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Dateiamenskonflikt zwischen den Erweiterungen support und order behoben."); break; - case "0.3.5": // SQL queries for v0.3.5 + case '0.3.5': // SQL queries for v0.3.5 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Das Mitglied konnte geziehlt die Anzahl Mailbuchungen durch Abspeichern seines Profiles beeinflussen. Der Fehler war eine falsche Tabellenspalte. Dies war max_mails, die durch das Mitglieder veränderbar ist und zur Festellung der Maximalen Mailbuchungen herangezogen wurde."); break; - case "0.3.6": // SQL queries for v0.3.6 + case '0.3.6': // SQL queries for v0.3.6 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Im Modul order (inc/modules/order.php) wurde fehlerhafterweise die Erweiterung beg getestet."); break; - case "0.3.7": // SQL queries for v0.3.7 + case '0.3.7': // SQL queries for v0.3.7 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("SQL-Anweisungen mit SQL_QUERY_ESC() abgesichert."); break; - case "0.3.8": // SQL queries for v0.3.8 + case '0.3.8': // SQL queries for v0.3.8 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Mailbuchungsseite korregiert."); break; - case "0.3.9": // SQL queries for v0.3.9 + case '0.3.9': // SQL queries for v0.3.9 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Erneuten Fehler in Mailbuchungsseite behoben."); break; - case "0.4.0": // SQL queries for v0.4.0 + case '0.4.0': // SQL queries for v0.4.0 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES(POINTS."-Abzug klappt wieder. Danke an Andreman!"); break; - case "0.4.1": // SQL queries for v0.4.1 + case '0.4.1': // SQL queries for v0.4.1 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Abspeichern von Einstellungen repariert."); break; - case "0.4.2": // SQL queries for v0.4.2 + case '0.4.2': // SQL queries for v0.4.2 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Vorbereitung auf die neue Mediendaten v0.0.4."); break; - case "0.4.3": // SQL queries for v0.4.3 + case '0.4.3': // SQL queries for v0.4.3 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Neue Urlaubsschaltung mit integriert."); break; - case "0.4.4": // SQL queries for v0.4.4 + case '0.4.4': // SQL queries for v0.4.4 // Update notes (these will be set as task text!) - EXT_SET_UPDATE_NOTES("Ein WHERE ext_active='Y' tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt."); + EXT_SET_UPDATE_NOTES("Ein WHERE `ext_active`='Y' tauchte bei einigen Betreibern auf und ist mit dieser Version beseitigt."); break; - case "0.4.5": // SQL queries for v0.4.5 + case '0.4.5': // SQL queries for v0.4.5 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("De-/Aktivieren des mit dieser Erweiterung verknüpften Modules eingebunden."); break; - case "0.4.6": // SQL queries for v0.4.6 - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order',NULL,'Mailbuchungen',3,'Y','N')"); - ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order','order2','Framekiller-Mails',2,'Y','N')"); - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='order', `sort`='1', `title`='Klick-Mails' WHERE `what`='order' LIMIT 1"); + case '0.4.6': // SQL queries for v0.4.6 + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order',NULL,'Mailbuchungen',3,'Y','N')"); + ADD_EXT_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`sort`,`visible`,`locked`) VALUES ('order','order2','Framekiller-Mails',2,'Y','N')"); + ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `action`='order', `sort`='1', `title`='Klick-Mails' WHERE `what`='order' LIMIT 1"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Mitgliedsmenü komplett umgebaut."); break; - case "0.4.7": // SQL queries for v0.4.7 + case '0.4.7': // SQL queries for v0.4.7 // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Fehlerhinweis bei deaktivierter Erweiterung verbessert."); break; - case "0.4.8": // SQL queries for v0.4.8 - ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Mailbuchung' WHERE `what`='config_order' LIMIT 1"); + case '0.4.8': // SQL queries for v0.4.8 + ADD_EXT_SQL("UPDATE `{!_MYSQL_PREFIX!}_admin_menu` SET `title`='Mailbuchung' WHERE `what`='config_order' LIMIT 1"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Menüpunkt "Mailbuchungsseite" nach "Mailbuchung" umbenannt und weitere Einstellungen aus Sonstige Einstellungen verschoben."); break; - case "0.4.9": // SQL queries for v0.4.9 - ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD repay_deleted_mails ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'"); + case '0.4.9': // SQL queries for v0.4.9 + ADD_EXT_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD repay_deleted_mails ENUM('REPAY','JACKPOT','SHRED') NOT NULL DEFAULT 'REPAY'"); // Update notes (these will be set as task text!) EXT_SET_UPDATE_NOTES("Bei Löschung von Mailbuchungen kann nun global entschieden werden (Einstellungen also), ob die verbliebenen {!POINTS!} wieder gutgeschrieben werden sollen oder in den Jackpot landen."); break; - case "0.5.0": // SQL queries for v0.5.0 - ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_url_blacklist`"); - ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_url_blacklist` ( + case '0.5.0': // SQL queries for v0.5.0 + ADD_EXT_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_url_blacklist`"); + ADD_EXT_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_url_blacklist` ( `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `url` VARCHAR(255) NOT NULL DEFAULT '', `pool_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, @@ -317,15 +317,15 @@ INDEX (`pool_id`) } break; -case "modify": // When the extension got modified +case 'modify': // When the extension got modified break; -case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. +case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305. break; default: // Do stuff when extension is loaded // Do daily reset only when installed and extension version is at least 0.1.1 - if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (GET_EXT_VERSION("order") >= "0.1.1")) { + if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (GET_EXT_VERSION('order') >= '0.1.1')) { // Reset mail order values $result_ext = SQL_QUERY("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__); } // END - if