A lot double-quotes rewritten to single-quotes, some redirect URLs fixed
[mailer.git] / inc / modules / admin / what-config_points.php
index b12fd674b47e363ec0c1dc66467e22037c7a4b60..a13f1cdd2036cf63b9cfeb4922ce462657830152 100644 (file)
 
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!IS_ADMIN())) {
-       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
+       $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php';
        require($INC);
 }
 
 // Add description as navigation point
-ADD_DESCR("admin", __FILE__);
+ADD_DESCR('admin', __FILE__);
 
 // Init variables
-$message = "";
+$message = '';
 
 // Is the 'sub' parameter set?
-if (REQUEST_ISSET_GET(('sub'))) {
+if (REQUEST_ISSET_GET('sub')) {
        // Yes, then do some sanity-checks
        switch (REQUEST_GET('sub'))
        {
@@ -60,8 +60,8 @@ if (REQUEST_ISSET_GET(('sub'))) {
                break;
 
        case "ref":
-               if (REQUEST_ISSET_GET(('do'))) {
-                       if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == "add")) {
+               if (REQUEST_ISSET_GET('do')) {
+                       if (((!REQUEST_ISSET_POST(('lvl'))) || (!REQUEST_ISSET_POST(('perc')))) && (REQUEST_GET('do') == 'add')) {
                                REQUEST_UNSET_POST('ok');
                        }
                }
@@ -83,7 +83,7 @@ if (IS_FORM_SENT()) {
        case "ref":
                switch (REQUEST_GET('do'))
                {
-               case "add":
+               case 'add':
                        ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_refdepths` (level, percents) VALUES ('".REQUEST_POST('lvl')."','".REQUEST_POST('perc')."')");
                        break;
 
@@ -112,7 +112,7 @@ if (IS_FORM_SENT()) {
                }
 
                // Update cache file
-               if (GET_EXT_VERSION("cache") >= "0.1.2") {
+               if (GET_EXT_VERSION('cache') >= '0.1.2') {
                        if ($GLOBALS['cache_instance']->loadCacheFile("refdepths")) $GLOBALS['cache_instance']->destroyCacheFile();
                }
                break;
@@ -169,27 +169,27 @@ WHERE mails_confirmed < %s", $REF, $REF));
        // Shall we display a message?
        if (!empty($message)) {
                // When do so...
-               LOAD_TEMPLATE("admin_settings_saved", false, $message);
+               LOAD_TEMPLATE('admin_settings_saved', false, $message);
        }
 } elseif (REQUEST_GET('sub') == "settings") {
        // Setup some settings like direct pay and so on
        // Including new add-mode for one-time referal bonus
        switch (getConfig('allow_direct_pay')) {
-       case "Y":
-               define('__DIRECT_Y', " checked=\"checked\"");
-               define('__DIRECT_N', "");
+       case 'Y':
+               define('__DIRECT_Y', ' chkecked="checked"');
+               define('__DIRECT_N', '');
                break;
 
-       case "N":
-               define('__DIRECT_Y', "");
-               define('__DIRECT_N', " checked=\"checked\"");
+       case 'N':
+               define('__DIRECT_Y', '');
+               define('__DIRECT_N', ' chkecked="checked"');
                break;
        }
 
        // One-time referal bonus add-mode
        switch (getConfig('reg_points_mode')) {
-               case "ref"   : define('__MODE_REF', " checked=\"checked\""); define('__MODE_DIRECT', "");         break;
-               case "direct": define('__MODE_REF', "");         define('__MODE_DIRECT', " checked=\"checked\""); break;
+               case "ref"   : define('__MODE_REF', ' chkecked="checked"'); define('__MODE_DIRECT', '');         break;
+               case "direct": define('__MODE_REF', '');         define('__MODE_DIRECT', ' chkecked="checked"'); break;
        }
 
        // Referal payout value
@@ -201,7 +201,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
        // 12                  3     32    2                  3     32    2               3            4     43    21
        if ((REQUEST_ISSET_POST('del')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
                // Delete entries
-               $OUT = ""; $SW = 2;
+               $OUT = ''; $SW = 2;
                foreach (REQUEST_POST('sel') as $id => $value) {
                        $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
                                array(bigintval($id)), __FILE__, __LINE__);
@@ -226,7 +226,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
                LOAD_TEMPLATE("admin_points_del");
        } elseif ((REQUEST_ISSET_POST('edit')) && (REQUEST_ISSET_POST('sel')) && (SELECTION_COUNT(REQUEST_POST('sel')) > 0)) {
                // Edit entries
-               $OUT = ""; $SW = 2;
+               $OUT = ''; $SW = 2;
                foreach (REQUEST_POST('sel') as $id => $value) {
                        $result = SQL_QUERY_ESC("SELECT level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` WHERE id=%s LIMIT 1",
                         array(bigintval($id)), __FILE__, __LINE__);
@@ -254,7 +254,7 @@ WHERE mails_confirmed < %s", $REF, $REF));
                $result = SQL_QUERY("SELECT id, level, percents FROM `{!_MYSQL_PREFIX!}_refdepths` ORDER BY level", __FILE__, __LINE__);
                if (SQL_NUMROWS($result) > 0) {
                        // Make referal levels editable and deletable
-                       $OUT = ""; $SW = 2;
+                       $OUT = ''; $SW = 2;
 
                        // List already existing categories for editing
                        while ($content = SQL_FETCHARRAY($result)) {