]> git.mxchange.org Git - mailer.git/commitdiff
Lesser use of double-quotes
authorRoland Häder <roland@mxchange.org>
Sun, 11 Jul 2010 22:54:50 +0000 (22:54 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 11 Jul 2010 22:54:50 +0000 (22:54 +0000)
inc/libs/rallye_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/modules/admin/what-guest_add.php
inc/modules/admin/what-mem_add.php
inc/modules/guest/what-stats.php
inc/modules/member/what-mydata.php
inc/modules/member/what-themes.php
inc/modules/member/what-transfer.php
inc/mysql-manager.php

index a840198c4ae9428c0e0b755f4a919e831f852312..b0fd3a9943681453f315d277b4a1bacc472cc6dd 100644 (file)
@@ -177,8 +177,8 @@ WHERE
 function addReferalRallyePrices ($rallye, $mode = 'email') {
        // Output mode
        switch($mode) {
 function addReferalRallyePrices ($rallye, $mode = 'email') {
        // Output mode
        switch($mode) {
-               case 'email': $mode = "\n";       break;
-               case 'html' : $mode = "<br />\n"; break;
+               case 'email': $mode = "\n";     break;
+               case 'html' : $mode = '<br />'; break;
        } // END - switch
 
        // Load prices
        } // END - switch
 
        // Load prices
index 81810de1d1a09172836f1310bc037f2566f85b2d..97034d5b9bc9a75fdd8fdc30277e4ed95db1b3cc 100644 (file)
@@ -423,7 +423,7 @@ function saveSponsorData ($postData, $content) {
        $sql = "UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET";
        foreach ($postData as $key => $value) {
                // Mmmmm, too less security here???
        $sql = "UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET";
        foreach ($postData as $key => $value) {
                // Mmmmm, too less security here???
-               $sql   .= " `".secureString($key)."`='%s',";
+               $sql   .= " `" . secureString($key) . "`='%s',";
 
                // We will secure this later inside the SQL_QUERY_ESC() function
                $DATA[] = secureString($value);
 
                // We will secure this later inside the SQL_QUERY_ESC() function
                $DATA[] = secureString($value);
@@ -448,7 +448,7 @@ function saveSponsorData ($postData, $content) {
        $sql = substr($sql, 0, -1);
 
        // Add SQL tail data
        $sql = substr($sql, 0, -1);
 
        // Add SQL tail data
-       $sql .= " WHERE `id`=%s AND password='%s' LIMIT 1";
+       $sql .= " WHERE `id`=%s AND `password`='%s' LIMIT 1";
        $DATA[] = bigintval(getSession('sponsorid'));
        $DATA[] = getSession('sponsorpass');
 
        $DATA[] = bigintval(getSession('sponsorid'));
        $DATA[] = getSession('sponsorpass');
 
index 8a4d3236196f09f0c3dbd99d3ef7c07125c6a18d..92655c666615c52b54cbed68b9b3d8f472186577 100644 (file)
@@ -189,8 +189,8 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
        $actionArray = SURFBAR_GET_ARRAY_FROM_STATUS($status);
 
        // Init HTML code
        $actionArray = SURFBAR_GET_ARRAY_FROM_STATUS($status);
 
        // Init HTML code
-       $OUT = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"1\" width=\"100%\">
-<tr>\n";
+       $OUT = '<table border="0" cellspacing="0" cellpadding="1" width="100%">
+<tr>';
 
        // Calculate width
        $width = round(100 / count($actionArray));
 
        // Calculate width
        $width = round(100 / count($actionArray));
@@ -208,8 +208,8 @@ function SURFBAR_MEMBER_ACTIONS ($urlId, $status) {
        } // END - foreach
 
        // Close table
        } // END - foreach
 
        // Close table
-       $OUT .= "</tr>
-</table>\n";
+       $OUT .= '</tr>
+</table>';
 
        // Return code
        return $OUT;
 
        // Return code
        return $OUT;
index d86210f5319ef5c7f1b4e9442c7f5405f596f993..01d81014c598024f7de1ebba89cd50a25ec3f20d 100644 (file)
@@ -40,7 +40,7 @@
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
 // Some security stuff...
 if ((!defined('__SECURITY')) || (!isAdmin())) {
        die();
-}
+} // END - if
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
@@ -56,7 +56,7 @@ if (!isFormSent()) {
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
        $menus = array(); $titles = array(); $below = array();
 
        // Get all available main menus
-       $result = SQL_QUERY("SELECT
+       $result_menu = SQL_QUERY("SELECT
        `action`, `title`, `sort`
 FROM
        `{?_MYSQL_PREFIX?}_guest_menu`
        `action`, `title`, `sort`
 FROM
        `{?_MYSQL_PREFIX?}_guest_menu`
@@ -64,10 +64,10 @@ WHERE
        (`what`='' OR `what` IS NULL)
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
        (`what`='' OR `what` IS NULL)
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
-       if (!SQL_HASZERONUMS($result)) {
+       if (!SQL_HASZERONUMS($result_menu)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                // Read menu structure
                // @TODO Cant this be rewritten?
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = SQL_FETCHARRAY($result_menu)) {
                        // Menu actions
                        $menus[] = $content['action'];
 
                        // Menu actions
                        $menus[] = $content['action'];
 
@@ -78,9 +78,6 @@ ORDER BY
                        $below[] = $content['sort'] + 1;
                } // END - while
 
                        $below[] = $content['sort'] + 1;
                } // END - while
 
-               // Free memory
-               SQL_FREERESULT($result);
-
                // Remove double eintries
                // @TODO This can be somehow rewritten to a function
                $prev = ''; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
                // Remove double eintries
                // @TODO This can be somehow rewritten to a function
                $prev = ''; $dmy = $menus; $dmy2 = $titles; $dmy3 = $below;
@@ -128,10 +125,7 @@ ORDER BY `sort` ASC",
 
                                        // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
                                        $below[$value_main][] = $content['sort'] + 1;
 
                                        // Below this menu point should the new be added so we simply increase the sort value by 1 :-)
                                        $below[$value_main][] = $content['sort'] + 1;
-                               }
-
-                               // Free memory
-                               SQL_FREERESULT($result);
+                               } // END - while
 
                                // Remove double eintries
                                // @TODO This can be somehow rewritten to a function
 
                                // Remove double eintries
                                // @TODO This can be somehow rewritten to a function
@@ -144,34 +138,40 @@ ORDER BY `sort` ASC",
                                        } else {
                                                $prev = $value;
                                        }
                                        } else {
                                                $prev = $value;
                                        }
-                               }
+                               } // END - foreach
 
                                // Transfer dummy array
                                $menus[$value_main] = $dmy;
                                $titles[$value_main] = $dmy2;
                                $below[$value_main] = $dmy3;
 
                                // Transfer dummy array
                                $menus[$value_main] = $dmy;
                                $titles[$value_main] = $dmy2;
                                $below[$value_main] = $dmy3;
-                       }
-               }
-       }
+                       } // END - if
+
+                       // Free memory
+                       SQL_FREERESULT($result);
+               } // END - foreach
+       } // END - if
+
+       // Free memory
+       SQL_FREERESULT($result_menu);
 
 
-       $OUT = "    <select class=\"admin_select\" name=\"sort\" size=\"1\">
-      <option value=\"0\">{--IS_FIRST_MENU--}</option>";
+       $OUT = '<select class="admin_select" name="sort" size="1">
+      <option value="0">{--IS_FIRST_MENU--}</option>';
        foreach ($below as $key => $m) {
                if (is_array($m)) {
                        foreach ($m as $key2 => $m2) {
        foreach ($below as $key => $m) {
                if (is_array($m)) {
                        foreach ($m as $key2 => $m2) {
-                               $OUT .= "      <option value=\"".$m2."\">".$titles[$key][$key2];
+                               $OUT .= '<option value="' . $m2 . '">' . $titles[$key][$key2];
                                foreach ($menus as $k => $v) {
                                        if (($v == $key) && (!is_array($v))) {
                                foreach ($menus as $k => $v) {
                                        if (($v == $key) && (!is_array($v))) {
-                                               $OUT .= " (" . $titles[$k] . ')';
+                                               $OUT .= ' (' . $titles[$k] . ')';
                                        }
                                }
                                        }
                                }
-                               $OUT .= "</option>\n";
+                               $OUT .= '</option>';
                        }
                } else {
                        }
                } else {
-                       $OUT .= "      <option value=\"".$m."\">".$titles[$key]."</option>\n";
+                       $OUT .= '<option value="' . $m . '">' . $titles[$key] . '</option>';
                }
        }
                }
        }
-       $OUT .= "</select>";
+       $OUT .= '</select>';
 
        // Prepare selections for template
        $content['below_selection']  = $OUT;
 
        // Prepare selections for template
        $content['below_selection']  = $OUT;
index 61be3eca8ef407a730a3e8214325a240a0a6b997..90ca4a69ace15916d4743cf1e19c0c81255d2784 100644 (file)
@@ -143,24 +143,24 @@ if (!isFormSent()) {
                } // END - foreach
        } // END - if
 
                } // END - foreach
        } // END - if
 
-       $OUT = "<select class=\"admin_select\" name=\"sort\" size=\"1\">
-      <option value=\"\">{--IS_FIRST_MENU--}</option>\n";
+       $OUT = '<select class="admin_select" name="sort" size="1">
+      <option value="">{--IS_FIRST_MENU--}</option>';
        foreach ($below as $key => $m) {
                if (is_array($m)) {
                        foreach ($m as $key2 => $m2) {
        foreach ($below as $key => $m) {
                if (is_array($m)) {
                        foreach ($m as $key2 => $m2) {
-                               $OUT .= "      <option value=\"" . $m2 . "\">" . $titles[$key][$key2];
+                               $OUT .= '<option value="' . $m2 . '">' . $titles[$key][$key2];
                                foreach ($menus as $k => $v) {
                                        if (($v == $key) && (!is_array($v))) {
                                foreach ($menus as $k => $v) {
                                        if (($v == $key) && (!is_array($v))) {
-                                               $OUT .= " (" . $titles[$k] . ')';
+                                               $OUT .= ' (' . $titles[$k] . ')';
                                        } // END - if
                                } // END - foreach
                                        } // END - if
                                } // END - foreach
-                               $OUT .= "</option>\n";
+                               $OUT .= '</option>';
                        } // END - foreach
                } else {
                        } // END - foreach
                } else {
-                       $OUT .= "      <option value=\"" . $m . "\">" . $titles[$key] . "</option>\n";
+                       $OUT .= '<option value="' . $m . '">' . $titles[$key] . '</option>';
                }
        }
                }
        }
-       $OUT .= "</select>";
+       $OUT .= '</select>';
 
        // Prepare selection boxes for template
        $content['below_selection']  = $OUT;
 
        // Prepare selection boxes for template
        $content['below_selection']  = $OUT;
index 9dd3fe910208e201b1f4628c94347de3751c654d..06cb3d8977ed9fc6eb68c5f3649e4b9ef0885b6a 100644 (file)
@@ -140,7 +140,7 @@ switch (getConfig('guest_stats')) {
                // Generate monthly stats
                $SW = 2; $r2 = ' right'; $l = 'll'; $r = 'lr'; $OUT = '';
                foreach ($months as $month => $cnt) {
                // Generate monthly stats
                $SW = 2; $r2 = ' right'; $l = 'll'; $r = 'lr'; $OUT = '';
                foreach ($months as $month => $cnt) {
-                       if ($SW == 2) $OUT .= "<tr>\n";
+                       if ($SW == 2) $OUT .= '<tr>';
 
                        // Prepare data for template
                        $data = array(
 
                        // Prepare data for template
                        $data = array(
@@ -158,7 +158,7 @@ switch (getConfig('guest_stats')) {
                                $r2 = '';
                                $l = 'rl'; $r = 'rr';
                        } else {
                                $r2 = '';
                                $l = 'rl'; $r = 'rr';
                        } else {
-                               $OUT .= "</tr>\n";
+                               $OUT .= '</tr>';
                                $r2 = ' right';
                                $l = 'll'; $r = 'lr';
                        }
                                $r2 = ' right';
                                $l = 'll'; $r = 'lr';
                        }
index 4d55270d0eb26c2c1215020c482b14c5ac5d622b..04bd239f2207be300980239eb61bbbab8b5918ee 100644 (file)
@@ -170,11 +170,11 @@ LIMIT 1",
 
                        if (isExtensionActive('country')) {
                                // Generate selection box
 
                        if (isExtensionActive('country')) {
                                // Generate selection box
-                               $OUT  = "<select name=\"country_code\" class=\"member_select\" size=\"1\">\n";
+                               $OUT  = '<select name="country_code" class="member_select" size="1">';
                                $whereStatement = "WHERE `is_active`='Y'";
                                if (isAdmin()) $whereStatement = '';
                                $OUT .= generateOptionList('countries', 'id', 'descr', $content['country_code'], 'code', $whereStatement);
                                $whereStatement = "WHERE `is_active`='Y'";
                                if (isAdmin()) $whereStatement = '';
                                $OUT .= generateOptionList('countries', 'id', 'descr', $content['country_code'], 'code', $whereStatement);
-                               $OUT .= "</select>";
+                               $OUT .= '</select>';
                                $content['country'] = $OUT;
                        } else {
                                // Ouput default input box
                                $content['country'] = $OUT;
                        } else {
                                // Ouput default input box
index f7381e612ba3d4b036de2d4fa3e20cf64db44b18..c53797daa0071ce1a3b184731b8d0a4132a33fd3 100644 (file)
@@ -114,19 +114,19 @@ foreach ($THEMES['theme_unix'] as $key => $unix) {
 
        // Add row
        // @TODO Move this code into a template
 
        // Add row
        // @TODO Move this code into a template
-       $OUT .= "<tr>
-  <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\" height=\"30\">
-    <input type=\"radio\" name=\"member_theme\" class=\"member_normal\" value=\"".$unix."\"".$default." />
+       $OUT .= '<tr>
+  <td class="{%template,ColorSwitch%} bottom right" align="center" height="30">
+    <input type="radio" name="member_theme" class="member_normal" value="' . $unix . '"' . $default . ' />
   </td>
   </td>
-  <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\">".$THEMES['theme_name'][$key]."</td>
-  <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\">
-    <a href=\"mailto:".$THEMES['theme_email'][$key]."?Subject=[Theme:] ".$THEMES['theme_name'][$key]." (".$unix.")'.'\">".$THEMES['theme_author'][$key]."</a>
+  <td class="{%template,ColorSwitch%} bottom right" align="center">' . $THEMES['theme_name'][$key] . '</td>
+  <td class="{%template,ColorSwitch%} bottom right" align="center">
+    <a href="mailto:' . $THEMES['theme_email'][$key] . '?Subject=[Theme:] ' . $THEMES['theme_name'][$key] . ' (' . $unix . ')'.'">' . $THEMES['theme_author'][$key] . '</a>
   </td>
   </td>
-  <td class=\"{%template,ColorSwitch%} bottom right\" align=\"center\">
-    <a href=\"".generateDerefererUrl($THEMES['theme_url'][$key])."\" target=\"_blank\">".$THEMES['theme_url'][$key]."</a>
+  <td class="{%template,ColorSwitch%} bottom right" align="center">
+    <a href="' . generateDerefererUrl($THEMES['theme_url'][$key]) . '" target="_blank">' . $THEMES['theme_url'][$key] . '</a>
   </td>
   </td>
-  <td class=\"{%template,ColorSwitch%} bottom\" align=\"center\">v".$THEMES['theme_version'][$key]."</td>
-</tr>\n";
+  <td class="{%template,ColorSwitch%} bottom" align="center">v' . $THEMES['theme_version'][$key] . '</td>
+</tr>';
 } // END - foreach
 
 if (empty($OUT)) {
 } // END - foreach
 
 if (empty($OUT)) {
index 85bff3a9f43dd243b03cd32f6cf0deff26d6b606..a141f3009a907bc2e0cbd3e6180508b89802c91f 100644 (file)
@@ -217,11 +217,11 @@ switch ($mode) {
 
                        if (!SQL_HASZERONUMS($result)) {
                                // Load list
 
                        if (!SQL_HASZERONUMS($result)) {
                                // Load list
-                               $OUT  = "<select name=\"to_userid\" size=\"1\" class=\"member_select\">
-       <option value=\"0\">{--SELECT_NONE--}</option>\n";
+                               $OUT  = '<select name="to_userid" size="1" class="member_select">
+       <option value="0">{--SELECT_NONE--}</option>';
                                // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
                                while (list($userid, $nick) = SQL_FETCHROW($result)) {
                                // @TODO Try to rewrite his to $content = SQL_FETCHARRAY(), see some lines above for two different queries
                                while (list($userid, $nick) = SQL_FETCHROW($result)) {
-                                       $OUT .= "       <option value=\"".$userid."\"";
+                                       $OUT .= '       <option value="' . $userid . '"';
                                        if ((isPostRequestParameterSet('to_userid')) && (postRequestParameter('to_userid') == $userid)) $OUT .= ' selected="selected"';
                                        $OUT .= '>';
                                        if (($nick != $userid) && (!empty($nick))) {
                                        if ((isPostRequestParameterSet('to_userid')) && (postRequestParameter('to_userid') == $userid)) $OUT .= ' selected="selected"';
                                        $OUT .= '>';
                                        if (($nick != $userid) && (!empty($nick))) {
@@ -327,11 +327,11 @@ switch ($mode) {
                        SQL_FREERESULT($result);
                } else {
                        // Nothing for in or out
                        SQL_FREERESULT($result);
                } else {
                        // Nothing for in or out
-                       $OUT = "<tr>
-  <td colspan=\"5\" align=\"center\" class=\"bottom\">
-    ".loadTemplate('admin_settings_saved', true, $nothingMessage)."
+                       $OUT = '<tr>
+  <td colspan="5" align="center" class="bottom">
+    ' . loadTemplate('admin_settings_saved', true, $nothingMessage) . '
   </td>
   </td>
-</tr>";
+</tr>';
                }
 
                // ... and add them to a constant for the template
                }
 
                // ... and add them to a constant for the template
index 45bd10646e9804c46928bb3529564d119a00a42f..e0e63f090e137b9d876348df8b7d32e85f903ef4 100644 (file)
@@ -109,7 +109,7 @@ function addMenuDescription ($accessLevel, $FQFN, $return = false) {
                if (isAdmin()) $ADD = '';
 
                $dummy = substr($search, 0, -4);
                if (isAdmin()) $ADD = '';
 
                $dummy = substr($search, 0, -4);
-               $ADD .= " AND `action`='".getActionFromModuleWhat($accessLevel, $dummy)."'";
+               $ADD .= sprintf(" AND `action`='%s'", getActionFromModuleWhat($accessLevel, $dummy));
        } elseif (($accessLevel == 'sponsor') || ($accessLevel == 'engine')) {
                // Sponsor / engine menu
                $type     = 'what';
        } elseif (($accessLevel == 'sponsor') || ($accessLevel == 'engine')) {
                // Sponsor / engine menu
                $type     = 'what';