]> git.mxchange.org Git - mailer.git/commitdiff
More use of REVERT_COMMA() fixes problems
authorRoland Häder <roland@mxchange.org>
Mon, 6 Oct 2008 17:46:56 +0000 (17:46 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 6 Oct 2008 17:46:56 +0000 (17:46 +0000)
14 files changed:
doubler.php
inc/databases.php
inc/libs/payout_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-config_beg.php
inc/modules/admin/what-config_bonus.php
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_newsletter.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-config_surfbar.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-list_sponsor_pay.php
inc/modules/member/what-payout.php
inc/modules/member/what-points.php

index ed96136bbc9f74fae92ccbb2d98123494a507b2a..8c56144ccf589fb3c87e1e410d36067905e706f7 100644 (file)
@@ -106,7 +106,7 @@ if (isBooleanConstantAndTrue('mxchange_installed')) {
                        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']));
index 17b8ea880879e9852cb56a1a70f0f9349db496c5..081fad27074d3a2cc4ccaca52eec6aae59559442 100644 (file)
@@ -113,7 +113,7 @@ define('USAGE_BASE', "usage");
 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);
index 95d03c0f6e1bcceb87e01c34eac833808250429b..eab3ad8fc0c8196c12570a9c7cb957920738f540 100644 (file)
@@ -41,7 +41,7 @@ if (!defined('__SECURITY')) {
 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!
index 8e583b643686f84c4c268eb5eddcc8fb45215eb1..0c7f5bfeee32742170a6f4246e3451b663b2b9d9 100644 (file)
@@ -645,7 +645,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName="_config", $whereStatement="con
                                // 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?
index 40d412e6b200c50db128ec27721d51983cc90874..5342beb5ad4a77e051c4c70c38f1ae8d4573f7a5 100644 (file)
@@ -43,9 +43,9 @@ ADD_DESCR("admin", basename(__FILE__));
 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);
index 9e4641d08ba8d59214ea3212055bd3fc642960e0..961168604c62d4f30368044e7e44c5e4909faf52 100644 (file)
@@ -43,17 +43,17 @@ ADD_DESCR("admin", basename(__FILE__));
 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));
index 42bbc12e74f992f41b11c2267b29f4af0af56074..48ab8b8cacebc239354325cd20ca0a5bec9064d4 100644 (file)
@@ -42,11 +42,11 @@ ADD_DESCR("admin", basename(__FILE__));
 
 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);
index c7dc393d5b64790d0af576fea30d162d2eec0389..f3d42154b113f87a75bf2f0f4c0c720f9514e1d7 100644 (file)
@@ -43,7 +43,7 @@ ADD_DESCR("admin", basename(__FILE__));
 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);
 }
index 58e04477de046797243f46724d9cc586ef937442..9859235a083c16f95f64c15a7a0784bf93a05eac 100644 (file)
@@ -40,7 +40,7 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
 // 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))
 {
@@ -104,8 +104,8 @@ allow_url='%s'
 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__);
                        }
index f48676718269975bfc4e0a7ee0bee4bfdc9ab54d..b615405e99f89ef273cb63fe4bbc844b39c61fdf 100644 (file)
@@ -43,9 +43,9 @@ ADD_DESCR("admin", basename(__FILE__));
 // 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);
index 9b4a761f0f5981343234693d32457297a2f937f9..8840a1a8759f2a26b0bf600e3084e9c533ddf07e 100644 (file)
@@ -105,7 +105,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) {
                        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",
@@ -128,7 +128,7 @@ if ((!empty($_GET['id'])) && (!empty($_GET['mode']))) {
                        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",
index 9f49ed635a8c272e9826c1dd58e428b3b9d23dc5..3e77ed7c0d83d9f6a82da0148c4a8bc2d72fb4a8 100644 (file)
@@ -97,7 +97,7 @@ if (isset($_POST['add'])) {
                // 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!
index b49491e1eb6d6cc333e4b9af526f0d9bfa64986a..25aa636c78b4d803a2f61833e8c60c9d604e5dcb 100644 (file)
@@ -81,7 +81,7 @@ if (empty($_GET['payout']))
        $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
@@ -184,7 +184,7 @@ ORDER BY p.payout_timestamp DESC",
                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))
index ec7275b3c578046cbcc8113556e0543526ff8bb9..e4935abd61b1135030065fb83c054b119901e602 100644 (file)
@@ -199,7 +199,7 @@ if (EXT_IS_ACTIVE("user")) {
 
 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)));
 }
 
 //