More double->single convertions
authorRoland Häder <roland@mxchange.org>
Wed, 29 Jul 2009 19:52:38 +0000 (19:52 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 29 Jul 2009 19:52:38 +0000 (19:52 +0000)
inc/extensions/ext-doubler.php
inc/libs/doubler_functions.php
inc/libs/surfbar_functions.php
inc/modules/admin/what-config_doubler.php
inc/modules/admin/what-config_holiday.php
inc/modules/admin/what-config_order.php
inc/modules/guest/what-doubler.php
inc/modules/member/what-doubler.php
inc/reset/reset_holiday.php

index 000c807..7d9f864 100644 (file)
@@ -243,7 +243,7 @@ PRIMARY KEY(id)
                                        break;
 
                                default: // Do stuff when extension is loaded
-                                       if ((isResetModeEnabled()) && (getConfig('doubler_send_mode') == "RESET")) {
+                                       if ((isResetModeEnabled()) && (getConfig('doubler_send_mode') == 'RESET')) {
                                                // So let's check for points
                                                ADD_INC_TO_POOL(sprintf("%sinc/doubler_send.php", constant('PATH')));
                                        }
index e7b890c..78464b4 100644 (file)
@@ -44,13 +44,13 @@ if (!defined('__SECURITY')) {
 
 // Generates a HTML table based on given data
 // @TODO Lame description
-function DOUBLER_GENERATE_TABLE ($uid = '0', $done='N', $ref='N', $sort="ASC") {
+function DOUBLER_GENERATE_TABLE ($uid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
        if (empty($cnt)) $cnt = 0;
        $add = ''; $DT_MODE = 0;
        if ($uid > 0) {
                // Load entries only from a single user
                $add = " AND `userid`='".bigintval($uid)."'";
-               $mode = 'member'; $COLS = "4"; $DT_MODE = '2';
+               $mode = 'member'; $COLS = '4'; $DT_MODE = '2';
                $NOT_FOUND = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
        } else {
                // Guest mode!
@@ -58,13 +58,13 @@ function DOUBLER_GENERATE_TABLE ($uid = '0', $done='N', $ref='N', $sort="ASC") {
                $NOT_FOUND = getMessage('DOUBLER_GUEST_NO_ENTRIES_FOUND');
        }
 
-       if (($done == 'Y') && ($sort == "ASC")) {
+       if (($done == 'Y') && ($sort == 'ASC')) {
                // Already payed out points (latest payouts first)
                $limit = getConfig('doubler_display_old');
-       } elseif ($sort == "ASC") {
+       } elseif ($sort == 'ASC') {
                // List entries which will receive their payout soon
                $limit = getConfig('doubler_display_pay');
-       } elseif ($sort == "DESC") {
+       } elseif ($sort == 'DESC') {
                // Newest entries
                $limit = getConfig('doubler_display_new');
        }
@@ -97,7 +97,7 @@ LIMIT ".$limit, __FUNCTION__, __LINE__);
                        );
 
                        // Load template and switch color
-                       $OUT .= LOAD_TEMPLATE($mode."_doubler_list_rows", true, $content);
+                       $OUT .= LOAD_TEMPLATE($mode . '_doubler_list_rows', true, $content);
                        $SW = 3 - $SW;
                }
 
@@ -113,7 +113,7 @@ LIMIT ".$limit, __FUNCTION__, __LINE__);
        }
 
        // Return template
-       return LOAD_TEMPLATE($mode."_doubler_list", true, $OUT);
+       return LOAD_TEMPLATE($mode . '_doubler_list', true, $OUT);
 }
 
 //
@@ -124,7 +124,7 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT() {
        if (getConfig('doubler_own') == 'Y') {
                // Take points from doubler's own account
                $points += getConfig('doubler_points') - getConfig('doubler_used');
-       }
+       } // END - if
 
        if (getConfig('doubler_jackpot') == 'Y') {
                // Load jackpot
@@ -137,7 +137,7 @@ function DOUBLER_GET_TOTAL_POINTS_LEFT() {
 
        if (getConfig('doubler_uid') > 0) {
                // Get user's points
-               $user = GET_TOTAL_DATA(getConfig('doubler_uid'), "user_points", "points");
+               $user = GET_TOTAL_DATA(getConfig('doubler_uid'), 'user_points', 'points');
                $points += $user;
        }
 
index f04a3b7..20f5402 100644 (file)
@@ -540,7 +540,7 @@ function SURFBAR_LOOKUP_BY_URL ($url, $uid) {
 }
 
 // Load URL data by given search term and column
-function SURFBAR_GET_URL_DATA ($searchTerm, $column='id', $order='id', $sort="ASC", $group='id', $add = '') {
+function SURFBAR_GET_URL_DATA ($searchTerm, $column = 'id', $order = 'id', $sort = 'ASC', $group = 'id', $add = '') {
        // By default nothing is found
        $GLOBALS['last_url_data'] = array();
 
index bd1bb4c..e230bd1 100644 (file)
@@ -108,7 +108,7 @@ if (isFormSent()) {
                        define('__DOUBLER_SEND_RESET' , '');
                        break;
 
-               case "RESET":
+               case 'RESET':
                        define('__DOUBLER_SEND_DIRECT', '');
                        define('__DOUBLER_SEND_RESET' , ' checked="checked"');
                        break;
index 21d9a27..4b28ce9 100644 (file)
@@ -54,7 +54,7 @@ if (isFormSent()) {
        define('__LOCKED'   , createTimeSelections(getConfig('holiday_lock')  , "holiday_lock"  , "WDh"));
 
        switch (getConfig('holiday_mode')) {
-               case "RESET":
+               case 'RESET':
                        define('__RESET_DEFAULT' , ' checked="checked"');
                        define('__DIRECT_DEFAULT', '');
                        break;
index 03a1d0d..3c1032b 100644 (file)
@@ -67,12 +67,12 @@ if (isFormSent()) {
 
        // Sorting mode (ascending / descending)
        switch (getConfig('order_mode')) {
-               case "ASC":
+               case 'ASC':
                        define('__ASC_DEFAULT' , ' selected="selected"');
                        define('__DESC_DEFAULT', '');
                        break;
 
-               case "DESC":
+               case 'DESC':
                        define('__ASC_DEFAULT' , '');
                        define('__DESC_DEFAULT', ' selected="selected"');
                        break;
@@ -130,7 +130,7 @@ if (isFormSent()) {
        define('__ORDER_SELECT', ORDER_SELECT_OPTION_LIST(getConfig('order_select')));
 
        // Load template
-       LOAD_TEMPLATE("admin_config_order");
+       LOAD_TEMPLATE('admin_config_order');
 }
 
 //
index 418557d..3c08ac9 100644 (file)
@@ -62,19 +62,18 @@ define('__REFID', $GLOBALS['refid']);
 define('__DOUBLER_COUNTER', getConfig('doubler_counter'));
 
 // Which mail-send-mode did the admin setup?
-switch (getConfig('doubler_send_mode'))
-{
-       case "DIRECT":
+switch (getConfig('doubler_send_mode')) {
+       case 'DIRECT':
                define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_DIRECT);
                break;
 
-       case "RESET":
+       case 'RESET':
                define('DOUBLER_PAYOUT_TIME', DOUBLER_PAYOUT_TIME_RESET);
                break;
 }
 
 // Generate table with already payed out doubles
-define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE('0', 'Y', 'N', "DESC"));
+define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE('0', 'Y', 'N', 'DESC'));
 
 // Generate table with next-to-run payouts
 define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE());
@@ -86,7 +85,7 @@ define('__TIMEOUT_MARK', createFancyTime(getConfig('doubler_timeout')));
 define('__LEFT_VALUE', DOUBLER_GET_TOTAL_POINTS_LEFT());
 
 // Load template
-LOAD_TEMPLATE("guest_doubler");
+LOAD_TEMPLATE('guest_doubler');
 
 //
 ?>
index d9fe1ec..190efc4 100644 (file)
@@ -79,11 +79,11 @@ define('__DOUBLER_COUNTER', translateComma(getConfig('doubler_counter')));
 
 // Which mail-send-mode did the admin setup?
 switch (getConfig('doubler_send_mode')) {
-       case "DIRECT":
+       case 'DIRECT':
                define('DOUBLER_PAYOUT_TIME', getMessage('DOUBLER_PAYOUT_TIME_DIRECT'));
                break;
 
-       case "RESET":
+       case 'RESET':
                define('DOUBLER_PAYOUT_TIME', getMessage('DOUBLER_PAYOUT_TIME_RESET'));
                break;
 
@@ -94,13 +94,13 @@ switch (getConfig('doubler_send_mode')) {
 }
 
 // Generate table with already payed out doubles
-define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE(getUserId(), 'Y', 'N', "DESC"));
+define('__DOUBLER_PAYOUT_HISTORY', DOUBLER_GENERATE_TABLE(getUserId(), 'Y', 'N', 'DESC'));
 
 // Generate table with next-to-run payouts
 define('__DOUBLER_PAYOUT_NEXT', DOUBLER_GENERATE_TABLE(getUserId()));
 
 // Generate table with refferal payouts
-define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE(getUserId(), 'N', 'Y', "DESC"));
+define('__DOUBLER_PAYOUT_REF', DOUBLER_GENERATE_TABLE(getUserId(), 'N', 'Y', 'DESC'));
 
 // Generate timemark
 define('__TIMEOUT_MARK', createFancyTime(getConfig('doubler_timeout')));
@@ -109,7 +109,7 @@ define('__TIMEOUT_MARK', createFancyTime(getConfig('doubler_timeout')));
 define('__LEFT_VALUE', translateComma(DOUBLER_GET_TOTAL_POINTS_LEFT()));
 
 // Load template
-LOAD_TEMPLATE("member_doubler");
+LOAD_TEMPLATE('member_doubler');
 
 //
 ?>
index b1fbc5d..d61b400 100644 (file)
@@ -45,7 +45,7 @@ if (!defined('__SECURITY')) {
 }
 
 // Do not execute when script is in CSS mode or no daily reset
-if ((getOutputMode() == 1) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == "RESET"))) return;
+if ((getOutputMode() == 1) || ((!isResetModeEnabled()) && (getConfig('holiday_mode') == 'RESET'))) return;
 //* DEBUG: */ echo basename(__FILE__)."<br />\n";
 
 // Check for holidays we need to enable and send email to user