From 577dc42a316a339ffaff8c78223fc67e591293a6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 29 Jul 2009 19:52:38 +0000 Subject: [PATCH] More double->single convertions --- inc/extensions/ext-doubler.php | 2 +- inc/libs/doubler_functions.php | 18 +++++++++--------- inc/libs/surfbar_functions.php | 2 +- inc/modules/admin/what-config_doubler.php | 2 +- inc/modules/admin/what-config_holiday.php | 2 +- inc/modules/admin/what-config_order.php | 6 +++--- inc/modules/guest/what-doubler.php | 11 +++++------ inc/modules/member/what-doubler.php | 10 +++++----- inc/reset/reset_holiday.php | 2 +- 9 files changed, 27 insertions(+), 28 deletions(-) diff --git a/inc/extensions/ext-doubler.php b/inc/extensions/ext-doubler.php index 000c807957..7d9f864f51 100644 --- a/inc/extensions/ext-doubler.php +++ b/inc/extensions/ext-doubler.php @@ -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'))); } diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index e7b890c039..78464b4f93 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -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; } diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index f04a3b7a91..20f540223f 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -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(); diff --git a/inc/modules/admin/what-config_doubler.php b/inc/modules/admin/what-config_doubler.php index bd1bb4c49c..e230bd1844 100644 --- a/inc/modules/admin/what-config_doubler.php +++ b/inc/modules/admin/what-config_doubler.php @@ -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; diff --git a/inc/modules/admin/what-config_holiday.php b/inc/modules/admin/what-config_holiday.php index 21d9a2798f..4b28ce9e57 100644 --- a/inc/modules/admin/what-config_holiday.php +++ b/inc/modules/admin/what-config_holiday.php @@ -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; diff --git a/inc/modules/admin/what-config_order.php b/inc/modules/admin/what-config_order.php index 03a1d0dad0..3c1032bcfb 100644 --- a/inc/modules/admin/what-config_order.php +++ b/inc/modules/admin/what-config_order.php @@ -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'); } // diff --git a/inc/modules/guest/what-doubler.php b/inc/modules/guest/what-doubler.php index 418557d367..3c08ac964f 100644 --- a/inc/modules/guest/what-doubler.php +++ b/inc/modules/guest/what-doubler.php @@ -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'); // ?> diff --git a/inc/modules/member/what-doubler.php b/inc/modules/member/what-doubler.php index d9fe1ec430..190efc40c2 100644 --- a/inc/modules/member/what-doubler.php +++ b/inc/modules/member/what-doubler.php @@ -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'); // ?> diff --git a/inc/reset/reset_holiday.php b/inc/reset/reset_holiday.php index b1fbc5d827..d61b400649 100644 --- a/inc/reset/reset_holiday.php +++ b/inc/reset/reset_holiday.php @@ -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__)."
\n"; // Check for holidays we need to enable and send email to user -- 2.39.5