Renamed all SQL-related functions to camel-case notation
[mailer.git] / inc / modules / admin / what-memedit.php
index f4cc8c9fe9082d337578953d4882fe8dc6d7be7c..606bac855b3d1977bbbd3782c8497eb2126cd530 100644 (file)
@@ -60,11 +60,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        foreach (postRequestElement('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $count++;
-                       $result = SQL_QUERY_ESC("SELECT `title`, `action`, `what` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+                       $result = sqlQueryEscaped("SELECT `title`, `action`, `what` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1) {
+                       if (sqlNumRows($result) == 1) {
                                // Entry found so we load the stuff...
-                               $content = SQL_FETCHARRAY($result);
+                               $content = sqlFetchArray($result);
                                $content = array(
                                        'count'  => $count,
                                        'sel'    => $sel,
@@ -84,7 +84,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                                // Load template
                                $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
                        }
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
                } // END - if
        } // END - foreach
 
@@ -104,11 +104,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        foreach (postRequestElement('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $count++;
-                       $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+                       $result = sqlQueryEscaped("SELECT `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1) {
+                       if (sqlNumRows($result) == 1) {
                                // Entry found so we load the stuff...
-                               list($title) = SQL_FETCHROW($result);
+                               list($title) = sqlFetchRow($result);
                                $content = array(
                                        'count' => $count,
                                        'sel'   => $sel,
@@ -126,7 +126,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                                // Load template
                                $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
                        }
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
                } // END - if
        } // END - foreach
 
@@ -145,11 +145,11 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        foreach (postRequestElement('sel') as $sel => $confirm) {
                if ($confirm == 1) {
                        $count++;
-                       $result = SQL_QUERY_ESC("SELECT `title`, `visible`, `locked` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
+                       $result = sqlQueryEscaped("SELECT `title`, `visible`, `locked` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) == 1) {
+                       if (sqlNumRows($result) == 1) {
                                // Entry found so we load the stuff...
-                               $content = SQL_FETCHARRAY($result);
+                               $content = sqlFetchArray($result);
                                $content = array(
                                        'count'   => $count,
                                        'menu'    => $content['title'],
@@ -169,7 +169,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                                // Load template
                                $OUT .= loadTemplate('admin_menu_404_row', TRUE, $content);
                        }
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
                } // END - if
        } // END - foreach
 
@@ -189,16 +189,16 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
 
        if (!empty($subMenu)) {
                // Edit sub menus
-               $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", __FILE__, __LINE__);
+               $result = sqlQuery("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC", __FILE__, __LINE__);
        } else {
                // Edit main menus
-               $result = SQL_QUERY("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
+               $result = sqlQuery("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
        }
 
        // Some are there?
-       if (!SQL_HASZERONUMS($result)) {
+       if (!ifSqlHasZeroNums($result)) {
                $count = '0'; $OUT = '';
-               while ($content = SQL_FETCHARRAY($result)) {
+               while ($content = sqlFetchArray($result)) {
                        // Set sub value
                        $content['sub'] = $subMenu;
 
@@ -208,7 +208,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                        if (($content['sort'] == '0') || (($content['sort'] == 1) && (!empty($subMenu)))) {
                                // Is highest position
                                $content['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=memedit&amp;sub=' . $content['sub'] . '&amp;act=' . $content['action'] . '&amp;w=' . $content['what'] . '&amp;tid=' . ($content['sort']+1) . '&amp;fid=' . $content['sort'] . '%}">{--LOWER--}</a>';
-                       } elseif ($count == SQL_NUMROWS($result)) {
+                       } elseif ($count == sqlNumRows($result)) {
                                // Is lowest position
                                $content['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=memedit&amp;sub=' . $content['sub'] . '&amp;act=' . $content['action'] . '&amp;w=' . $content['what'] . '&amp;tid=' . ($content['sort']-1) . '&amp;fid=' . $content['sort'] . '%}">{--HIGHER--}</a>';
                        } elseif ($content['sort'] > 0) {
@@ -224,7 +224,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                } // END - while
 
                // Free memory
-               SQL_FREERESULT($result);
+               sqlFreeResult($result);
 
                // Remember rows/sub in array
                $content['rows'] = $OUT;