From 9eb4caf6c374ebfb37b73e4549ef6fba9462dcee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 31 Oct 2009 15:51:34 +0000 Subject: [PATCH] Menu moved to extension, index_delay should not have UNSIGNED --- inc/extensions/ext-bonus.php | 47 ++++++++++++++++-------------- inc/extensions/ext-order.php | 22 +++++++++----- inc/extensions/ext-sql_patches.php | 13 +++++++-- inc/functions.php | 16 +++++----- inc/modules/admin/admin-inc.php | 27 +++++++++-------- inc/wrapper-functions.php | 2 +- install/menu-de.sql | 1 - install/menu-en.sql | 1 - 8 files changed, 74 insertions(+), 55 deletions(-) diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 5c944d5d78..f8650b319d 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -39,13 +39,13 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Version of this extension -setThisExtensionVersion('0.8.8'); +setThisExtensionVersion('0.8.9'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.1.6', '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', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8')); +setExtensionVersionHistory(array('0.0', '0.1.6', '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', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', '0.8.7', '0.8.8', '0.8.9')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) @@ -120,17 +120,15 @@ PRIMARY KEY (id) break; case '0.2.1': // SQL queries for v0.2.1 - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_bonus' LIMIT 1"); - addAdminMenuSql('setup','config_bonus','Bonus-{OPEN_CONFIG}POINTS{CLOSE_CONFIG}','Richten Sie Bonus-{OPEN_CONFIG}POINTS{CLOSE_CONFIG} ein, die beim x'ten Klick auf die Mail verbucht werden sollen. Beispiele: Der 1. Klick sollte mehr {OPEN_CONFIG}POINTS{CLOSE_CONFIG} zusätzlich bekommen, als der 10. Klick.',8); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 10.000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 100.000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD login_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY').""); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD turbo_rates VARCHAR(255) NOT NULL DEFAULT '50;20;10'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_ranks TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_bonus` FLOAT(20,3) NOT NULL DEFAULT 10.000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_bonus` FLOAT(20,3) NOT NULL DEFAULT 100.000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY').""); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_rates` VARCHAR(255) NOT NULL DEFAULT '50;20;10'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_ranks` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10"); // Use actual month for this update - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD login_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD turbo_bonus FLOAT(20,3) NOT NULL DEFAULT 0.000"); - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET ext_has_css='Y' WHERE `ext_name`='bonus' AND ext_has_css='N' LIMIT 1"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `login_bonus` FLOAT(20,3) NOT NULL DEFAULT 0.000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `turbo_bonus` FLOAT(20,3) NOT NULL DEFAULT 0.000"); + addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_has_css`='Y' WHERE `ext_name`='bonus' AND `ext_has_css`='N' LIMIT 1"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Login-Bonus und Turbo-Klick-Bonus intergriert."); @@ -283,13 +281,13 @@ KEY userid (userid) break; case '0.4.4': // SQL queries for v0.4.4 - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 15.00000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '5.00000'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD bonus_active ENUM('Y','N') NOT NULL DEFAULT 'Y'"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD bonus_order FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD bonus_ref FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD bonus_stats FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_order` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 15.00000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_ref` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 100.00000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_stats` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT '5.00000'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_active` ENUM('Y','N') NOT NULL DEFAULT 'Y'"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `bonus_order` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `bonus_ref` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `bonus_stats` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000"); // Update notes (these will be set as task text!) setExtensionUpdateNotes("Bonus-{?POINTS?} für: Mailbestellung, Referal-Werbung (bei Best. der EMail-Adresse) und wenn 100% Klickrate jeder Mailbuchung erreicht wurde.
Template admin_config_bonus_pro.tpl ist überflüssig geworden. Bitte löschen Sie dies!
Eingestellte Bonus-{?POINTS?} für Rank 2 war um eins verschoben."); @@ -399,8 +397,6 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); break; case '0.6.4': // SQL queries for v0.6.4 - addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Aktiv-Rallye' WHERE `what`='config_bonus' LIMIT 1"); - // Update notes (these will be set as task text!) setExtensionUpdateNotes("Der Menüpunkt "Bonus-{?POINTS?}" unter Einstellungen wird nach "Aktiv-Rallye umbenannt. Und die Aktiv-Rallye konnte aufgrund eines Template-Fehlers nicht gespeichert werden."); break; @@ -534,6 +530,13 @@ WHERE `last_online` < ".$mark." ORDER BY `userid` ASC"); case '0.8.8': // SQL queries for v0.8.8 addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_stats` ADD `bonus_stats_active` ENUM('Y','N') NOT NULL DEFAULT 'N'"); + // Update notes + setExtensionUpdateNotes("Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt."); + break; + + case '0.8.9': // SQL queries for v0.8.9 + addAdminMenuSql('setup','config_bonus','Aktiv-Rallye','Richten Sie eine komplette Aktiv-Rallye hier ein. Legen Sie Vergütungen fest, die die Mitglieder für bestimmte Aktionen auf ihr Aktiv-Konto gutgeschrieben bekommen sollen.',8); + // Update notes setExtensionUpdateNotes("Benachrichtigungsmails für z.B. Bettel- oder Aktiv-Rallye werden nun angezeigt."); break; diff --git a/inc/extensions/ext-order.php b/inc/extensions/ext-order.php index 697d9e9e47..bb195dd84b 100644 --- a/inc/extensions/ext-order.php +++ b/inc/extensions/ext-order.php @@ -39,13 +39,13 @@ // Some security stuff... if (!defined('__SECURITY')) { die(); -} +} // END - if // Version number -setThisExtensionVersion('0.5.0'); +setThisExtensionVersion('0.5.1'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(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')); +setExtensionVersionHistory(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', '0.5.1')); switch (getExtensionMode()) { case 'register': // Do stuff when installation is running (modules.php?module=admin is called) @@ -55,7 +55,8 @@ switch (getExtensionMode()) { case 'remove': // Do stuff when removing extension // SQL commands to run - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order'"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order' LIMIT 1"); + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='order' LIMIT 1"); break; case 'activate': // Do stuff when admin activates this extension @@ -81,9 +82,9 @@ switch (getExtensionMode()) { break; case '0.1.1': // SQL queries for v0.1.1 - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order' LIMIT 1"); - addAdminMenuSql('setup','config_order','Mailbuchungsseite',7,'Einstellungen am Mailbuchungsformular.'); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD mail_orders BIGINT(20) UNSIGNED NOT NULL DEFAULT 0"); + // OLD QUERIES: addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_order' LIMIT 1"); + // OLD QUERIES: addAdminMenuSql('setup','config_order','Mailbuchungsseite','Einstellungen am Mailbuchungsformular.',7); + addExtensionSql("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!) setExtensionUpdateNotes("Maximale Mailbuchung vervollständigt (Admin-Bereich und im Buchungsformular selber)."); @@ -311,6 +312,13 @@ INDEX (`pool_id`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Tabelle für URL-Sperrliste angelegt."); break; + + case '0.5.1': // SQL queries for v0.5.1 + addMemberMenuSql('main','order','Mailbuchung','N','Y',8); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Weiteren Menü-Query in Erweiterung verlagert."); + break; } break; diff --git a/inc/extensions/ext-sql_patches.php b/inc/extensions/ext-sql_patches.php index 04d07edf6f..3a2eae891a 100644 --- a/inc/extensions/ext-sql_patches.php +++ b/inc/extensions/ext-sql_patches.php @@ -42,10 +42,10 @@ if (!defined('__SECURITY')) { } // END - if // Version number -setThisExtensionVersion('0.6.6'); +setThisExtensionVersion('0.6.7'); // Version history array (add more with , '0.1.0' and so on) -setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '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', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6')); +setExtensionVersionHistory(array('0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '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', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7')); // Keep this extension always active! setExtensionAlwaysActive('Y'); @@ -207,7 +207,7 @@ switch (getExtensionMode()) { case '0.1.1': // SQL queries for v0.1.1 addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `title`='Home-/Eingangsseite', descr='Stellen Sie hier ein, welcher Menüpunkt (what-welcome ist Standart) als Einstiegspunkt in das Menüsystem genutzt werden soll und wie die automatische Weiterleitung in der Eingangsseite funktionieren soll.' WHERE `what`='config_home' LIMIT 1"); - addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_delay` TINYINT(3) UNSIGNED NOT NULL DEFAULT 0"); + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_delay` TINYINT(3) NOT NULL DEFAULT 0"); addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `index_cookie` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*365).""); // Update notes (these will be set as task text!) @@ -712,6 +712,13 @@ PRIMARY KEY (`filter_id`) // Update notes (these will be set as task text!) setExtensionUpdateNotes("Die Sicherheitseinstellungen, {?POINTS?}-Einstellungen und Email-Archiv funktionieren nur, wenn diese Erweiterung installiert ist."); break; + + case '0.6.7': // SQL queries for v0.6.7 + addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `index_delay` `index_delay` TINYINT(3) NOT NULL DEFAULT 0"); + + // Update notes (these will be set as task text!) + setExtensionUpdateNotes("Die Weiterleitungseinstellung muss auch Werte kleiner Null akzeptieren."); + break; } // END - switch break; diff --git a/inc/functions.php b/inc/functions.php index 57e2c10364..020ceb819a 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -3013,6 +3013,7 @@ function handleExtraValues ($filterFunction, $value, $extraValue) { // Converts timestamp selections into a timestamp function convertSelectionsToTimestamp (&$postData, &$DATA, &$id, &$skip) { // Init test variable + $skip = false; $test2 = ''; // Get last three chars @@ -3025,21 +3026,20 @@ function convertSelectionsToTimestamp (&$postData, &$DATA, &$id, &$skip) { if ((isset($postData[$test.'_ye'])) && (isset($postData[$test.'_mo'])) && (isset($postData[$test.'_we'])) && (isset($postData[$test.'_da'])) && (isset($postData[$test.'_ho'])) && (isset($postData[$test.'_mi'])) && (isset($postData[$test.'_se'])) && ($test != $test2)) { // Generate timestamp $postData[$test] = createTimestampFromSelections($test, $postData); - $DATA[] = sprintf("%s='%s'", $test, $postData[$test]); + $DATA[] = sprintf("`%s`='%s'", $test, $postData[$test]); + $GLOBALS['skip_config'][$test] = true; // Remove data from array foreach (array('ye', 'mo', 'we', 'da', 'ho', 'mi', 'se') as $rem) { - unset($postData[$test.'_' . $rem]); + unset($postData[$test . '_' . $rem]); } // END - foreach // Skip adding - unset($id); $skip = true; $test2 = $test; + unset($id); + $skip = true; + $test2 = $test; } // END - if - } else { - // Process this entry - $skip = false; - $test2 = ''; - } + } // END - if } // Reverts the german decimal comma into Computer decimal dot diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index a1df0f2277..66a7223bd4 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -544,7 +544,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') { } // Wrapper for $_POST and adminSaveSettings -function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = 'config=0', $translateComma = array(), $alwaysAdd = false) { +function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false) { // Get the array $postData = postRequestArray(); @@ -553,7 +553,7 @@ function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement } // Save settings to the database -function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = 'config=0', $translateComma = array(), $alwaysAdd = false) { +function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = false) { // Prepare all arrays, variables $DATA = array(); $skip = false; @@ -566,7 +566,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement convertSelectionsToTimestamp($postData, $DATA, $id, $skip); // Shall we process this ID? It muss not be empty, of course - if (($skip === false) && (!empty($id))) { + if (($skip === false) && (!empty($id)) && (!isset($GLOBALS['skip_config'][$id]))) { // Save this entry $val = compileCode($val); @@ -578,7 +578,7 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement // Shall we add numbers or strings? $test = (float)$val; - if ("".$val."" == ''.$test."") { + if ('' . $val . '' == '' . $test . '') { // Add numbers $DATA[] = sprintf("`%s`=%s", $id, $test); } else { @@ -586,6 +586,9 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement $DATA[] = sprintf("`%s`='%s'", $id, trim($val)); } + // Do not add a config entry twice + $GLOBALS['skip_config'][$id] = true; + // Update current configuration setConfigEntry($id, $val); } // END - if @@ -608,9 +611,9 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement // Generate SQL string $sql = sprintf("UPDATE `{?_MYSQL_PREFIX?}%s` SET %s WHERE %s LIMIT 1", - $tableName, - $DATA_UPDATE, - $whereStatement + $tableName, + $DATA_UPDATE, + $whereStatement ); } else { // Add Line (does only work with auto_increment! @@ -622,14 +625,14 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement } // END - foreach // Add both in one line - $KEYs = implode(', ', $KEYs); + $KEYs = implode('`, `', $KEYs); $values = implode(', ', $values); // Generate SQL string - $sql = sprintf("INSERT INTO {?_MYSQL_PREFIX?}%s (%s) VALUES (%s)", - $tableName, - $KEYs, - $values + $sql = sprintf("INSERT INTO `{?_MYSQL_PREFIX?}%s` (%s) VALUES (%s)", + $tableName, + $KEYs, + $values ); } diff --git a/inc/wrapper-functions.php b/inc/wrapper-functions.php index 0f89445a06..c7711857d6 100644 --- a/inc/wrapper-functions.php +++ b/inc/wrapper-functions.php @@ -566,7 +566,7 @@ function isModuleSet ($abortOnMiss = false) { // Should we abort here? if (($abortOnMiss === true) && ($isset === false)) { // Output backtrace - print '
';
+		print 'Module not set!
';
 		debug_print_backtrace();
 		die('