SQL_FREERESULT($result);
// Remove any dots and unwanted chars from the points
- $_POST['points'] = bigintval(round(str_replace(",", ".", $_POST['points'])));
+ $_POST['points'] = bigintval(round(REVERT_COMMA($_POST['points'])));
// Probe for enough points
$probe_points = (($_POST['points'] >= $_CONFIG['doubler_min']) && ($_POST['points'] <= $_CONFIG['doubler_max']));
define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "463");
+define('CURR_SVN_REVISION', "464");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
function PAYOUT_OUTPUT_PAYOUT_LIST($points)
{
// Replace german decimal comma with CPU's decimal dot
- $points = strval(str_replace(",", ".", $points));
+ $points = strval(REVERT_COMMA($points));
if ($points > 0)
{
// Pay this out!
// Translate the value? (comma to dot!)
if ((is_array($translateComma)) && (in_array($id, $translateComma))) {
// Then do it here... :)
- $val = str_replace(",", ".", $val);
+ $val = REVERT_COMMA($val);
} // END - if
// Shall we add numbers or strings?
if (isset($_POST['ok']))
{
// Translate german decimal commas to computer decimal dots
- $_POST['beg_points'] = str_replace(",", ".", $_POST['beg_points'] );
- $_POST['beg_points_max'] = str_replace(",", ".", $_POST['beg_points_max'] );
- $_POST['beg_notify_bonus'] = str_replace(",", ".", $_POST['beg_notify_bonus']);
+ $_POST['beg_points'] = REVERT_COMMA($_POST['beg_points'] );
+ $_POST['beg_points_max'] = REVERT_COMMA($_POST['beg_points_max'] );
+ $_POST['beg_notify_bonus'] = REVERT_COMMA($_POST['beg_notify_bonus']);
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
if (isset($_POST['ok']))
{
// Replace german decimal commas to computer decimal dots
- $_POST['login_bonus'] = str_replace(",", ".", $_POST['login_bonus'] );
- $_POST['turbo_bonus'] = str_replace(",", ".", $_POST['turbo_bonus'] );
- $_POST['bonus_ref'] = str_replace(",", ".", $_POST['bonus_ref'] );
- $_POST['bonus_order'] = str_replace(",", ".", $_POST['bonus_order'] );
- $_POST['bonus_notify_points'] = str_replace(",", ".", $_POST['bonus_notify_points']);
+ $_POST['login_bonus'] = REVERT_COMMA($_POST['login_bonus'] );
+ $_POST['turbo_bonus'] = REVERT_COMMA($_POST['turbo_bonus'] );
+ $_POST['bonus_ref'] = REVERT_COMMA($_POST['bonus_ref'] );
+ $_POST['bonus_order'] = REVERT_COMMA($_POST['bonus_order'] );
+ $_POST['bonus_notify_points'] = REVERT_COMMA($_POST['bonus_notify_points']);
// Generate string for saving ranks
$_POST['turbo_rates'] = ""; $RATES = array();
foreach ($_POST['rate'] as $rate)
{
- $rate = trim(str_replace(",", ".", $rate));
+ $rate = trim(REVERT_COMMA($rate));
if (isset($rate)) $RATES[] = $rate;
}
$_POST['turbo_rates'] = trim(implode(";", $RATES));
if (isset($_POST['ok'])) {
// Replace commata with decimal dot
- $_POST['doubler_charge'] = str_replace(",", ".", ($_POST['doubler_charge'] / 100));
- $_POST['doubler_ref'] = str_replace(",", ".", ($_POST['doubler_ref'] / 100));
- $_POST['doubler_min'] = str_replace(",", ".", $_POST['doubler_min']);
- $_POST['doubler_max'] = str_replace(",", ".", $_POST['doubler_max']);
- $_POST['doubler_left'] = str_replace(",", ".", $_POST['doubler_left']);
+ $_POST['doubler_charge'] = REVERT_COMMA(($_POST['doubler_charge'] / 100));
+ $_POST['doubler_ref'] = REVERT_COMMA(($_POST['doubler_ref'] / 100));
+ $_POST['doubler_min'] = REVERT_COMMA($_POST['doubler_min']);
+ $_POST['doubler_max'] = REVERT_COMMA($_POST['doubler_max']);
+ $_POST['doubler_left'] = REVERT_COMMA($_POST['doubler_left']);
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
if (isset($_POST['ok']))
{
// Save data
- $_POST['nl_charge'] = str_replace(",", ".", $_POST['nl_charge']);
+ $_POST['nl_charge'] = REVERT_COMMA($_POST['nl_charge']);
ADMIN_SAVE_SETTINGS($_POST);
}
// Add description as navigation point
ADD_DESCR("admin", basename(__FILE__));
-if (!empty($_POST['rate'])) $_POST['rate'] = str_replace(",", ".", $_POST['rate']);
+if (!empty($_POST['rate'])) $_POST['rate'] = REVERT_COMMA($_POST['rate']);
if ((isset($_POST['add'])) && (!empty($_POST['title'])) && ($_POST['rate'] > 0))
{
WHERE id='".$id."' LIMIT 1",
array(
$_POST['title'][$id],
- bigintval(str_replace(",", ".", $_POST['rate'][$id])),
- bigintval(str_replace(",", ".", $_POST['mpoi'][$id])),
+ bigintval(REVERT_COMMA($_POST['rate'][$id])),
+ bigintval(REVERT_COMMA($_POST['mpoi'][$id])),
$_POST['allow'][$id],
),__FILE__, __LINE__);
}
// Was the form submitted?
if (isset($_POST['ok'])) {
// Replace german decimal comma with computer decimal dot
- if (isset($_POST['surfbar_static_reward'])) $_POST['surfbar_static_reward'] = str_replace(",", ".", $_POST['surfbar_static_reward']);
- if (isset($_POST['surfbar_static_costs'])) $_POST['surfbar_static_costs'] = str_replace(",", ".", $_POST['surfbar_static_costs']);
- if (isset($_POST['surfbar_dynamic_percent'])) $_POST['surfbar_dynamic_percent'] = str_replace(",", ".", $_POST['surfbar_dynamic_percent']);
+ if (isset($_POST['surfbar_static_reward'])) $_POST['surfbar_static_reward'] = REVERT_COMMA($_POST['surfbar_static_reward']);
+ if (isset($_POST['surfbar_static_costs'])) $_POST['surfbar_static_costs'] = REVERT_COMMA($_POST['surfbar_static_costs']);
+ if (isset($_POST['surfbar_dynamic_percent'])) $_POST['surfbar_dynamic_percent'] = REVERT_COMMA($_POST['surfbar_dynamic_percent']);
// Save settings
ADMIN_SAVE_SETTINGS($_POST);
case "add_points": // Add points
if (strval($_POST['points']) > 0) {
// Replace german decimal comma with computer's decimal dot
- $POINTS = strval(str_replace(",", ".", $_POST['points']));
+ $POINTS = strval(REVERT_COMMA($_POST['points']));
// Add points to account
$result_add = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_amount=points_amount+%s WHERE id='%s' LIMIT 1",
case "sub_points": // Subtract points
if (strval($_POST['points']) > 0) {
// Replace german decimal comma with computer's decimal dot
- $POINTS = strval(str_replace(",", ".", $_POST['points']));
+ $POINTS = strval(REVERT_COMMA($_POST['points']));
// Add points to account
$result_add = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_sponsor_data SET points_used=points_used+%s WHERE id='%s' LIMIT 1",
// No entry found so add this line
$result = SQL_QUERY_ESC("INSERT INTO "._MYSQL_PREFIX."_sponsor_paytypes (pay_name, pay_rate, pay_min_count, pay_currency)
VALUES ('%s','%s','%s','%s')",
- array(htmlspecialchars($_POST['pay_name']), str_replace(",", ".", $_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])),
+ array(htmlspecialchars($_POST['pay_name']), REVERT_COMMA($_POST['pay_rate']), bigintval($_POST['pay_min_count']), htmlspecialchars($_POST['pay_currency'])),
__FILE__, __LINE__);
// Payment type added!
$result = SQL_QUERY_ESC("SELECT id, type, rate, min_points, allow_url
FROM "._MYSQL_PREFIX."_payout_types
WHERE %s >= min_points
-ORDER BY type", array(str_replace(",", ".", $TPTS)), __FILE__, __LINE__);
+ORDER BY type", array(REVERT_COMMA($TPTS)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0)
{
// Free memory
define('PAYOUT_MAX_VALUE' , $max);
define('PAYOUT_TYPE_VALUE', COMPILE_CODE($type));
- if (str_replace(",", ".", $TPTS) >= $min)
+ if (REVERT_COMMA($TPTS) >= $min)
{
// Ok, he can get be paid
if ((isset($_POST['ok'])) && ($PAYOUT <= $PAY_MAX) && ($PAYOUT >= $min))
if (EXT_IS_ACTIVE("payout")) {
// Payput extension is installed and active so we can check if the user has enougth points
- PAYOUT_OUTPUT_PAYOUT_LIST(str_replace(",", ".", ($TPTS - $USED)));
+ PAYOUT_OUTPUT_PAYOUT_LIST(REVERT_COMMA(($TPTS - $USED)));
}
//