From: Roland Häder Date: Tue, 2 Dec 2008 19:15:17 +0000 (+0000) Subject: Some fixes, surfbar fixed reload is now in select boxes X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=7076b0bf4f326c0dcb87daa0e02e15b0f42e619e;p=mailer.git Some fixes, surfbar fixed reload is now in select boxes --- diff --git a/inc/databases.php b/inc/databases.php index 25f1607c87..b8c28bd10e 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,8 +113,8 @@ define('USAGE_BASE', "usage"); // Server-URL (DO NOT CHANGE THIS OR YOU CANNOT CHECK FOR UPDATES/EXTENSIONS!) define('SERVER_URL', "http://www.mxchange.org"); -// This current patch level -define('CURR_SVN_REVISION', "583"); +// Current SVN revision +define('CURR_SVN_REVISION', "584"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index 5a8a571579..1a863f6df8 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2522,31 +2522,31 @@ function FILE_READABLE($fqfn) { // Converts timestamp selections into a timestamp function CONVERT_SELECTIONS_TO_TIMESTAMP(&$POST, &$DATA, &$id, &$skip) { // Init test variable - $TEST2 = ""; + $test2 = ""; // Get last three chars - $TEST = substr($id, -3); + $test = substr($id, -3); // Improved way of checking! :-) - if (in_array($TEST, array("_ye", "_mo", "_we", "_da", "_ho", "_mi", "_se"))) { + if (in_array($test, array("_ye", "_mo", "_we", "_da", "_ho", "_mi", "_se"))) { // Found a multi-selection for timings? - $TEST = substr($id, 0, -3); - if ((isset($POST[$TEST."_ye"])) && (isset($POST[$TEST."_mo"])) && (isset($POST[$TEST."_we"])) && (isset($POST[$TEST."_da"])) && (isset($POST[$TEST."_ho"])) && (isset($POST[$TEST."_mi"])) && (isset($POST[$TEST."_se"])) && ($TEST != $TEST2)) { + $test = substr($id, 0, -3); + if ((isset($POST[$test."_ye"])) && (isset($POST[$test."_mo"])) && (isset($POST[$test."_we"])) && (isset($POST[$test."_da"])) && (isset($POST[$test."_ho"])) && (isset($POST[$test."_mi"])) && (isset($POST[$test."_se"])) && ($test != $test2)) { // Generate timestamp - $POST[$TEST] = CREATE_TIMESTAMP_FROM_SELECTIONS($TEST, $POST); - $DATA[] = "$TEST='".$POST[$TEST]."'"; + $POST[$test] = CREATE_TIMESTAMP_FROM_SELECTIONS($test, $POST); + $DATA[] = sprintf("%s='%s'", $test, $POST[$test]); // Remove data from array foreach (array("ye", "mo", "we", "da", "ho", "mi", "se") as $rem) { - unset($POST[$TEST."_".$rem]); + unset($POST[$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 = ""; + $skip = false; $test2 = ""; } } // 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 ea7df656ea..d6b6c0b65e 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -656,10 +656,10 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $test = (float)$val; if ("".$val."" == "".$test."") { // Add numbers - $DATA[] = $id."=".$val.""; + $DATA[] = sprintf("`%s`=%s%s", $id, $test); } else { // Add strings - $DATA[] = $id."='".trim($val)."'"; + $DATA[] = sprintf("`%s`='%s'", $id, trim($val)); } // Update current configuration @@ -672,9 +672,9 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $result = false; if (!$alwaysAdd) { if (!empty($whereStatement)) { - $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX.$tableName." WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT * FROM `"._MYSQL_PREFIX.$tableName."` WHERE ".$whereStatement." LIMIT 1", __FILE__, __LINE__); } else { - $result = SQL_QUERY("SELECT * FROM "._MYSQL_PREFIX.$tableName." LIMIT 1", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT * FROM `"._MYSQL_PREFIX.$tableName."` LIMIT 1", __FILE__, __LINE__); } } // END - if @@ -683,7 +683,11 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $DATA_UPDATE = implode(", ", $DATA); // Generate SQL string - $SQL = "UPDATE "._MYSQL_PREFIX.$tableName." SET ".$DATA_UPDATE." WHERE ".$whereStatement." LIMIT 1"; + $SQL = sprintf("UPDATE `"._MYSQL_PREFIX."%s` SET %s WHERE %s LIMIT 1", + $tableName, + $DATA_UPDATE, + $whereStatement + ); } else { // Add Line (does only work with auto_increment! $KEYs = array(); $VALUEs = array(); @@ -698,7 +702,11 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con $VALUEs = implode(", ", $VALUEs); // Generate SQL string - $SQL = "INSERT INTO "._MYSQL_PREFIX.$tableName." (".$KEYs.") VALUES (".$VALUEs.")"; + $SQL = sprintf("INSERT INTO "._MYSQL_PREFIX."%s (%s) VALUES (%s)", + $tableName, + $KEYs, + $VALUEs + ); } // Free memory diff --git a/inc/modules/admin/what-add_surfbar_url.php b/inc/modules/admin/what-add_surfbar_url.php index bfe1425c55..d60a9d8602 100644 --- a/inc/modules/admin/what-add_surfbar_url.php +++ b/inc/modules/admin/what-add_surfbar_url.php @@ -41,7 +41,13 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { ADD_DESCR("admin", __FILE__); // Was an URL added? -if ((isset($_POST['add'])) && (!empty($_POST['url'])) && (!empty($_POST['limit']))) { +if ((isset($_POST['add'])) && (!empty($_POST['url']))) { + // Dummy variables + $DATA = array(); $id = "reload_ye"; $skip = false; + + // Convert the "reload selections" + CONVERT_SELECTIONS_TO_TIMESTAMP($_POST, $DATA, $id, $skip); + // Then add this URL if (SURFBAR_ADMIN_ADD_URL($_POST['url'], $_POST['limit'], $_POST['reload'])) { // URL was added @@ -52,8 +58,13 @@ if ((isset($_POST['add'])) && (!empty($_POST['url'])) && (!empty($_POST['limit'] } } // END - if +// Prepare content for template +$content = array( + 'reload' => CREATE_TIME_SELECTIONS(0, "reload", "WDhms") +); + // Load template -LOAD_TEMPLATE("admin_add_surfbar_url"); +LOAD_TEMPLATE("admin_add_surfbar_url", false, $content); // ?> diff --git a/inc/modules/admin/what-config_newsletter.php b/inc/modules/admin/what-config_newsletter.php index d5f22e249e..d8564cec27 100644 --- a/inc/modules/admin/what-config_newsletter.php +++ b/inc/modules/admin/what-config_newsletter.php @@ -40,20 +40,18 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save data $_POST['nl_charge'] = REVERT_COMMA($_POST['nl_charge']); ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare contants for the template define('__CHARGE_VALUE' , TRANSLATE_COMMA($_CONFIG['nl_charge'], false)); // Prepare constants and load template LOAD_TEMPLATE("admin_config_newsletter", false); } + // ?> diff --git a/inc/modules/admin/what-config_user.php b/inc/modules/admin/what-config_user.php index c097c77dda..f2fcbbcbc2 100644 --- a/inc/modules/admin/what-config_user.php +++ b/inc/modules/admin/what-config_user.php @@ -39,13 +39,10 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { // Add description as navigation point ADD_DESCR("admin", __FILE__); -if (isset($_POST['ok'])) -{ +if (isset($_POST['ok'])) { // Save settings ADMIN_SAVE_SETTINGS($_POST); -} - else -{ +} else { // Prepare constants for the template define('__LIMIT_VALUE', $_CONFIG['user_limit']); define('__ALPHA_VALUE', $_CONFIG['user_alpha']); diff --git a/templates/de/html/admin/admin_add_surfbar_url.tpl b/templates/de/html/admin/admin_add_surfbar_url.tpl index c45e3fa62d..b9d766352e 100644 --- a/templates/de/html/admin/admin_add_surfbar_url.tpl +++ b/templates/de/html/admin/admin_add_surfbar_url.tpl @@ -14,7 +14,7 @@
- Reloadsperre: {--_SECONDS--}
+ Reloadsperre: $content[reload] (0 = Standarteinstellungen)