Even more double->single converted
authorRoland Häder <roland@mxchange.org>
Mon, 29 Jul 2013 23:30:41 +0000 (23:30 +0000)
committerRoland Häder <roland@mxchange.org>
Mon, 29 Jul 2013 23:30:41 +0000 (23:30 +0000)
12 files changed:
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-edit_sponsor.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-list_network_array_translation.php
inc/modules/admin/what-list_network_request_params.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-list_unconfirmed.php
inc/modules/admin/what-theme_import.php

index 33c5428..4a94e8f 100644 (file)
@@ -614,10 +614,10 @@ function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement
                        // Shall we add numbers or strings?
                        if ('' . $val . '' == '' . $test . '') {
                                // Add numbers
-                               array_push($tableData, sprintf("`%s`=%s", $id, $test));
+                               array_push($tableData, sprintf('`%s`=%s', $id, $test));
                        } elseif (is_null($val)) {
                                // Add NULL
-                               array_push($tableData, sprintf("`%s`=NULL", $id));
+                               array_push($tableData, sprintf('`%s`=NULL', $id));
                        } else {
                                // Add strings
                                array_push($tableData, sprintf("`%s`='%s'", $id, trim($val)));
@@ -1247,7 +1247,7 @@ function adminUpdateTaskData ($id, $row, $data) {
                reportBug(__FUNCTION__, __LINE__, 'id=' . $id . ',row=' . $row . ',data=' . $data . ' - isAdmin()=false');
        } elseif ($id <= 0) {
                // Initiate backtrace
-               reportBug(__FUNCTION__, __LINE__, sprintf("id is invalid: %s. row=%s, data=%s",
+               reportBug(__FUNCTION__, __LINE__, sprintf('id is invalid: %s. row=%s, data=%s',
                        $id,
                        $row,
                        $data
@@ -1531,7 +1531,7 @@ function adminProcessMenuEditForm ($type, $subMenu) {
                                break;
 
                        default: // Unexpected action
-                               logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+                               logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok')));
                                displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
                                break;
                } // END - switch
@@ -1663,7 +1663,7 @@ function registerFirstAdmin () {
 
                        default:
                                // Any other kind will be logged
-                               $errorMessage = sprintf("Unknown return code %s from ifAdminLoginDataIsValid().", $ret);
+                               $errorMessage = sprintf('Unknown return code %s from ifAdminLoginDataIsValid().', $ret);
                                logDebugMessage(__FUNCTION__, __LINE__, $errorMessage);
 
                                // Set this to have our error message displayed
index 026068e..e42defe 100644 (file)
@@ -319,7 +319,7 @@ LIMIT 1",
                                                // @TODO This may also be rewritten to include files
                                                switch ($mode) {
                                                        default: // @TODO Unknown support mode
-                                                       logDebugMessage(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction.", $mode));
+                                                       logDebugMessage(__FILE__, __LINE__, sprintf('Unknown support mode %s detected. This part is under construction.', $mode));
                                                        $OUT .= '<div class="notice medium">{%message,ADMIN_UNKNOWN_SUPPORT_MODE=' . $mode . '%}</div>';
                                                        break;
                                                } // END - switch
@@ -386,7 +386,7 @@ LIMIT 1",
                                                break;
 
                                        default: // Unknown task type
-                                               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type']));
+                                               logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', $taskData['task_type']));
                                                $OUT .= '<div class="notice medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '</div>';
                                                break;
                                }
@@ -418,7 +418,7 @@ LIMIT 1",
                                } // END - foreach
                        } else {
                                // Unknown action
-                               reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, TRUE)));
+                               reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=<pre>%s</pre>', print_r($postData, TRUE)));
                        }
 
                        // Update query
index d2bd89b..28b590b 100644 (file)
@@ -185,7 +185,7 @@ LIMIT 1",
                        break;
 
                default: // Unexpected action
-                       logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+                       logDebugMessage(__FILE__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok')));
                        displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
                        break;
        } // END - switch
index 7753f42..b255c9c 100644 (file)
@@ -78,12 +78,12 @@ if ((isFormSent('do_delete')) || (isFormSent('do_edit')) || (isFormSent('do_add'
                        );
                        if ((getRefPayout() == '0') && (postRequestElement('ref_payout') > 0)) {
                                // Update account's ref_payout for "must-confirm"
-                               addSql(sprintf("UPDATE
+                               addSql(sprintf('UPDATE
        `{?_MYSQL_PREFIX?}_user_data`
 SET
        `ref_payout`=(%s - `mails_confirmed`)
 WHERE
-       `mails_confirmed` < %s", $REF, $REF));
+       `mails_confirmed` < %s', $REF, $REF));
                        } elseif ((getRefPayout() > 0) && (postRequestElement('ref_payout') == '0')) {
                                // Update account's ref_payout for "not-must-confirm"
                                addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
index 1fe5197..e96163d 100644 (file)
@@ -65,7 +65,7 @@ LIMIT 1",
                $content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
 
                // Init variables here
-               $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('do'));
+               $TPL = sprintf('admin_edit_sponsor_%s', getRequestElement('do'));
                initSqls();
 
                // Sponsor was found
@@ -79,7 +79,11 @@ LIMIT 1",
 
                                                // Add points to account
                                                sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`=%s LIMIT 1",
-                                                       array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+                                                       array(
+                                                               $points,
+                                                               bigintval(getRequestElement('id'))
+                                                       ), __FILE__, __LINE__
+                                               );
 
                                                // Remember points /reason for the template
                                                $content['points'] = $points;
@@ -145,10 +149,10 @@ LIMIT 1",
                                        break;
 
                                default: // Unknown mode
-                                       logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('do')));
+                                       logDebugMessage(__FILE__, __LINE__, sprintf('Unknown mode %s detected.', getRequestElement('do')));
                                        $message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestElement('do') . '%}';
                                        break;
-                       }
+                       } // END - switch
 
                        if (!empty($message)) {
                                // Output message
index d0b8d13..31621b7 100644 (file)
@@ -76,7 +76,7 @@ $SQL2 = '';
 
 if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
        // Only a specific mail shall be displayed
-       $sql = sprintf("SELECT
+       $sql = sprintf('SELECT
        `id`,
        `sender`,
        `subject`,
@@ -93,13 +93,13 @@ FROM
        `{?_MYSQL_PREFIX?}_pool`
 WHERE
        `id`=%s
-LIMIT 1",
+LIMIT 1',
                bigintval(getRequestElement('id'))
        );
        $WHO = '{--MAIL_ID--}' . ': ' . getRequestElement('id');
 } elseif (isGetRequestElementSet('userid')) {
        // All mails by a specific member shall be displayed
-       $sql = sprintf("SELECT
+       $sql = sprintf('SELECT
        `id`,
        `sender`,
        `subject`,
@@ -117,7 +117,7 @@ FROM
 WHERE
        `sender`=%s
 ORDER BY
-       `timestamp` DESC",
+       `timestamp` DESC',
                bigintval(getRequestElement('userid'))
        );
        $WHO = '{--USER_ID--}' . ': ' . getRequestElement('userid');
index b5140da..eb3708d 100644 (file)
@@ -112,7 +112,7 @@ if (isGetRequestElementSet('userid')) {
                                                        break;
 
                                                default: // Problem in application detected!
-                                                       reportBug(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $linkData['link_type']));
+                                                       reportBug(__FILE__, __LINE__, sprintf('Invalid email type %s detected.', $linkData['link_type']));
                                                        break;
                                        } // END - switch
 
index 202791f..edcf7cb 100644 (file)
@@ -76,7 +76,7 @@ if (isGetRequestElementSet('network_id')) {
        $ADD = '';
        if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) {
                // Only show from current type handler
-               $ADD = sprintf(" AND `p`.`network_type_id`=%s", bigintval(postRequestElement('network_type_id')));
+               $ADD = sprintf(' AND `p`.`network_type_id`=%s', bigintval(postRequestElement('network_type_id')));
 
                // Overwrite type
                $networkData['network_type_id'] = bigintval(postRequestElement('network_type_id'));
@@ -86,7 +86,7 @@ if (isGetRequestElementSet('network_id')) {
        } // END - if
 
        // Load all advert codes for given network
-       $result = sqlQueryEscaped("SELECT
+       $result = sqlQueryEscaped('SELECT
        `p`.`network_array_id`,
        `t`.`network_type_id`,
        `t`.`network_type_handler`,
@@ -100,10 +100,10 @@ ON
        `p`.`network_type_id`=`t`.`network_type_id`
 WHERE
        `p`.`network_id`=%s
-       ".$ADD."
+       ' . $ADD . '
 ORDER BY
        `t`.`network_type_handler` ASC,
-       `p`.`network_array_sort` ASC",
+       `p`.`network_array_sort` ASC',
                array(
                        bigintval(getRequestElement('network_id'))
                ), __FILE__, __LINE__);
index 1f2487e..0ef1d09 100644 (file)
@@ -74,7 +74,7 @@ if (isGetRequestElementSet('network_id')) {
        $ADD = '';
        if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) {
                // Only show from current type handler
-               $ADD = sprintf(" AND `p`.`network_type_id`=%s", bigintval(postRequestElement('network_type_id')));
+               $ADD = sprintf(' AND `p`.`network_type_id`=%s', bigintval(postRequestElement('network_type_id')));
 
                // Overwrite type id
                $networkData['network_type_id'] = bigintval(postRequestElement('network_type_id'));
index ff171fd..5f9da90 100644 (file)
@@ -74,7 +74,7 @@ switch (getRequestElement('type')) {
                break;
 
        default: // Unknown type
-               logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", getRequestElement('type')));
+               logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', getRequestElement('type')));
                displayMessage('{%message,ADMIN_TASK_UNKNOWN_MODE' . getRequestElement('type') . '%}');
                break;
 } // END - switch
@@ -121,7 +121,7 @@ ORDER BY
                                } // END - foreach
                        } else {
                                // Unknown action performed
-                               reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), TRUE)));
+                               reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=<pre>%s</pre>', print_r(postRequestArray(), TRUE)));
                        }
 
                        // Update query
index cd6da11..822d58d 100644 (file)
@@ -57,7 +57,7 @@ $sql = '';
 // List confirmation links from normal or bonus mails
 if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
        // SQL query for mail data
-       $sql = sprintf("SELECT
+       $sql = sprintf('SELECT
        `s`.`id`,
        `p`.`sender`,
        `p`.`subject`,
@@ -73,7 +73,7 @@ ON
        `p`.`id`=`s`.`pool_id`
 WHERE
        `s`.`pool_id`=%s
-LIMIT 1",
+LIMIT 1',
                bigintval(getRequestElement('id'))
        );
 
@@ -87,7 +87,7 @@ LIMIT 1",
        $DATA = getRequestElement('id');
 } elseif (((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'bonus')) && (isExtensionActive('bonus'))) {
        // SQL query for mail data (both ids are required for compatiblity to above normal mail
-       $sql = sprintf("SELECT
+       $sql = sprintf('SELECT
        `id`,
        NULL AS `sender`,
        `subject`,
@@ -99,7 +99,7 @@ FROM
        `{?_MYSQL_PREFIX?}_bonus`
 WHERE
        `id`=%s
-LIMIT 1",
+LIMIT 1',
                bigintval(getRequestElement('id'))
        );
 
index 0d8c7ae..8e08532 100644 (file)
@@ -50,13 +50,10 @@ $GLOBALS['theme_mode'] = 'test';
 if (isPostRequestElementSet('theme')) {
        // Check if theme is there
        if (!ifThemeExists(postRequestElement('theme'))) {
-               // Import theme
-               $inc = sprintf("theme/%s/theme.php", sqlEscapeString(postRequestElement('theme')));
-
                // Is the theme readable?
-               if (isIncludeReadable($inc)) {
+               if (isThemeReadable(postRequestElement('theme'))) {
                        // Load the theme header file
-                       loadInclude($inc);
+                       loadInclude(sprintf('theme/%s/theme.php', sqlEscapeString(postRequestElement('theme'))));
 
                        // Register it ith the exchange
                        sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`)