// 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);
// 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
$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
$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
$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();
$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
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
}
} // 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);
//
?>
// 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);
}
+
//
?>
// 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']);
</div>
<div class="admin_input" style="padding-top:5px;padding-bottom:5px" align="center">
- Reloadsperre: <input type="text" name="reload" size="5" maxlength="20" value="0" /> {--_SECONDS--}<br />
+ Reloadsperre: $content[reload]
<span class="admin_note">(0 = Standarteinstellungen)</span>
</div>