Some variable rewrites
[mailer.git] / inc / modules / admin / admin-inc.php
index 288510d631cd95a701c338fb6a2a3765ebc7ea51..a8f107f87f3c548b99473a2904b79b47df4282a9 100644 (file)
@@ -607,7 +607,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
                $DATA_UPDATE = implode(", ", $DATA);
 
                // Generate SQL string
-               $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}%s` SET %s WHERE %s LIMIT 1",
+               $sql = sprintf("UPDATE `{!_MYSQL_PREFIX!}%s` SET %s WHERE %s LIMIT 1",
                        $tableName,
                        $DATA_UPDATE,
                        $whereStatement
@@ -626,7 +626,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
                $VALUEs = implode(", ", $VALUEs);
 
                // Generate SQL string
-               $SQL = sprintf("INSERT INTO {!_MYSQL_PREFIX!}%s (%s) VALUES (%s)",
+               $sql = sprintf("INSERT INTO {!_MYSQL_PREFIX!}%s (%s) VALUES (%s)",
                        $tableName,
                        $KEYs,
                        $VALUEs
@@ -637,7 +637,7 @@ function ADMIN_SAVE_SETTINGS (&$POST, $tableName = "_config", $whereStatement =
        SQL_FREERESULT($result);
 
        // Simply run generated SQL string
-       SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+       SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
        // Rebuild cache
        REBUILD_CACHE("config", "config");
@@ -882,7 +882,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                // "Walk" through all entries
                foreach ($IDs as $id => $sel) {
                        // Construct SQL query
-                       $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}_%s` SET",
+                       $sql = sprintf("UPDATE `{!_MYSQL_PREFIX!}_%s` SET",
                                SQL_ESCAPE($table)
                        );
 
@@ -904,7 +904,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                                // Does the entry exist?
                                if ((isset($content[$column])) && (isset($statusInfo[$content[$column]]))) {
                                        // Add these entries for update
-                                       $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]]));
+                                       $sql .= sprintf(" %s='%s',", SQL_ESCAPE($column), SQL_ESCAPE($statusInfo[$content[$column]]));
 
                                        // Remember status
                                        if ($statusColumn == "unknown") {
@@ -926,10 +926,10 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                                        // Are there brackets () at the end?
                                        if (substr($entries[$id], -2, 2) == "()") {
                                                // Direct SQL command found
-                                               $SQL .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
+                                               $sql .= sprintf(" %s=%s,", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
                                        } else {
                                                // Add regular entry
-                                               $SQL .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
+                                               $sql .= sprintf(" %s='%s',", SQL_ESCAPE($key), SQL_ESCAPE($entries[$id]));
 
                                                // Add entry
                                                $content[$key] = $entries[$id];
@@ -938,7 +938,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                        } // END - foreach
 
                        // Finish SQL statement
-                       $SQL = substr($SQL, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1",
+                       $sql = substr($sql, 0, -1) . sprintf(" WHERE %s=%s AND %s='%s' LIMIT 1",
                                $idColumn,
                                bigintval($id),
                                $statusColumn,
@@ -946,7 +946,7 @@ function ADMIN_BUILD_STATUS_HANDLER ($mode, $IDs, $table, $columns, $filterFunct
                        );
 
                        // Run the SQL
-                       SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+                       SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
                        // Do we have an URL?
                        if (isset($content['url'])) {
@@ -967,7 +967,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                // Shall we delete here or list for deletion?
                if ($deleteNow) {
                        // The base SQL command:
-                       $SQL = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s IN (%s)";
+                       $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_%s` WHERE %s IN (%s)";
 
                        // Delete them all
                        $idList = "";
@@ -993,7 +993,7 @@ function ADMIN_DELETE_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFu
                        } // END - foreach
 
                        // Run the query
-                       SQL_QUERY($SQL, array($table, $idColumn, substr($idList, 0, -1)), __FUNCTION__, __LINE__);
+                       SQL_QUERY($sql, array($table, $idColumn, substr($idList, 0, -1)), __FUNCTION__, __LINE__);
 
                        // Was this fine?
                        if (SQL_AFFECTEDROWS() == count($IDs)) {
@@ -1023,7 +1023,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                $content = array();
 
                                // Prepare SQL for this row
-                               $SQL = sprintf("UPDATE `{!_MYSQL_PREFIX!}_ SET",
+                               $sql = sprintf("UPDATE `{!_MYSQL_PREFIX!}_ SET",
                                        SQL_ESCAPE($table)
                                );
                                foreach (REQUEST_POST_ARRAY() as $key => $entries) {
@@ -1045,7 +1045,7 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                                } // END - if
 
                                                // Then add this value
-                                               $SQL .= sprintf(" %s='%s',",
+                                               $sql .= sprintf(" %s='%s',",
                                                        SQL_ESCAPE($key),
                                                        SQL_ESCAPE($entries[$id])
                                                );
@@ -1062,10 +1062,10 @@ function ADMIN_EDIT_ENTRIES_CONFIRM ($IDs, $table, $columns=array(), $filterFunc
                                } // END - foreach
 
                                // Finish SQL command
-                               $SQL = substr($SQL, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1";
+                               $sql = substr($sql, 0, -1) . " WHERE ".$idColumn."=".bigintval($id)." LIMIT 1";
 
                                // Run this query
-                               SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+                               SQL_QUERY($sql, __FUNCTION__, __LINE__);
 
                                // Add affected rows
                                $affected += SQL_AFFECTEDROWS();