]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/admin/what-list_cats.php
Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-list_cats.php
index e3ba169e2492dd2f5d2a5be9f3e362a4e1918a52..53cdead13af9c8d193358f96a4198202b1cd4e53 100644 (file)
@@ -49,11 +49,11 @@ $CATS = '';
 
 if (isFormSent('add')) {
        // Add a new category
 
 if (isFormSent('add')) {
        // Add a new category
-       $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `cat`='%s' LIMIT 1",
+       $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `cat`='%s' LIMIT 1",
                array(postRequestElement('catname')), __FILE__, __LINE__);
                array(postRequestElement('catname')), __FILE__, __LINE__);
-       if (SQL_HASZERONUMS($result)) {
+       if (ifSqlHasZeroNums($result)) {
                // Category does not exists, we simply add it...
                // Category does not exists, we simply add it...
-               SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
+               sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
                        array(
                                postRequestElement('catname'),
                                postRequestElement('visible'),
                        array(
                                postRequestElement('catname'),
                                postRequestElement('visible'),
@@ -66,7 +66,7 @@ if (isFormSent('add')) {
        }
 
        // Free memory
        }
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Display message
        displayMessage($content);
 
        // Display message
        displayMessage($content);
@@ -81,7 +81,7 @@ if (isFormSent('add')) {
                if (!empty($cat)) {
                        switch (getRequestElement('do')) {
                                case 'edit': // Change categories
                if (!empty($cat)) {
                        switch (getRequestElement('do')) {
                                case 'edit': // Change categories
-                                       SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_cats` SET `cat`='%s',`visible`='%s',`sort`=%s WHERE `id`=%s LIMIT 1",
+                                       sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_cats` SET `cat`='%s',`visible`='%s',`sort`=%s WHERE `id`=%s LIMIT 1",
                                                array(
                                                        $cat,
                                                        postRequestElement('visible', $id),
                                                array(
                                                        $cat,
                                                        postRequestElement('visible', $id),
@@ -92,9 +92,9 @@ if (isFormSent('add')) {
                                        break;
 
                                case 'delete': // Delete categories
                                        break;
 
                                case 'delete': // Delete categories
-                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+                                       sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
                                                array($id), __FILE__, __LINE__);
                                                array($id), __FILE__, __LINE__);
-                                       SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s",
+                                       sqlQueryEscaped("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s",
                                                array($id), __FILE__, __LINE__);
                                        $TEXT = '{--ADMIN_CATEGORIES_DELETED--}';
                                        break;
                                                array($id), __FILE__, __LINE__);
                                        $TEXT = '{--ADMIN_CATEGORIES_DELETED--}';
                                        break;
@@ -124,12 +124,12 @@ if (isFormSent('add')) {
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
                // Load data from the category
        $OUT = '';
        foreach (postRequestElement('sel') as $id => $value) {
                // Load data from the category
-               $result = SQL_QUERY_ESC("SELECT `id`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+               $result = sqlQueryEscaped("SELECT `id`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
                        array(bigintval($id)), __FILE__, __LINE__);
                        array(bigintval($id)), __FILE__, __LINE__);
-               $content = SQL_FETCHARRAY($result);
+               $content = sqlFetchArray($result);
 
                // Free result
 
                // Free result
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Prepare data for the row template
                $content['visible_selection'] = addSelectionBox('yn', $content['visible'], 'visible', $content['id']);
 
                // Prepare data for the row template
                $content['visible_selection'] = addSelectionBox('yn', $content['visible'], 'visible', $content['id']);
@@ -145,13 +145,13 @@ if (isFormSent('add')) {
        $CATS = '';
 
        // Load all categories
        $CATS = '';
 
        // Load all categories
-       $result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
-       if (!SQL_HASZERONUMS($result)) {
+       $result = sqlQuery("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
+       if (!ifSqlHasZeroNums($result)) {
                // Init variables
                $OUT = '';
 
                // List already existing categories for editing
                // Init variables
                $OUT = '';
 
                // List already existing categories for editing
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Put cat descriptions into variable for the selection box
                        if (strlen($content['cat']) > 40) $content['cat'] = substr($content['cat'], 0, 37) . '...';
                        $CATS .= '<option value="' . $content['sort'] . '">' . $content['cat'] . '</option>';
                        // Put cat descriptions into variable for the selection box
                        if (strlen($content['cat']) > 40) $content['cat'] = substr($content['cat'], 0, 37) . '...';
                        $CATS .= '<option value="' . $content['sort'] . '">' . $content['cat'] . '</option>';
@@ -161,7 +161,7 @@ if (isFormSent('add')) {
                } // END - while
 
                // Free memory
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Load main template
                loadTemplate('admin_list_cats', FALSE, $OUT);
 
                // Load main template
                loadTemplate('admin_list_cats', FALSE, $OUT);