Removed deprecated 'hidden' column from mod_reg table.
[mailer.git] / inc / modules / admin / what-list_mods.php
index 98bb9476a101986bdcabb9c1c79d7ed4911343a3..38ee36972a77d0e6f6dec0f064aea8899f55a086 100644 (file)
@@ -53,18 +53,28 @@ if (isFormSent('edit')) {
                foreach (postRequestElement('sel') as $id => $sel) {
                        // Load module data
                        // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
-                       $result = SQL_QUERY_ESC("SELECT `id`, `module`, `title`, `locked`, `hidden`, `admin_only`, `mem_only` FROM `{?_MYSQL_PREFIX?}_mod_reg` WHERE `id`=%s LIMIT 1",
+                       $result = sqlQueryEscaped('SELECT
+       `id`,
+       `module`,
+       `title`,
+       `locked`,
+       `admin_only`,
+       `mem_only`
+FROM
+       `{?_MYSQL_PREFIX?}_mod_reg`
+WHERE
+       `id`=%s
+LIMIT 1',
                                array(bigintval($id)), __FILE__, __LINE__);
 
                        // Load data
-                       $content = SQL_FETCHARRAY($result);
+                       $content = sqlFetchArray($result);
 
                        // Free result
-                       SQL_FREERESULT($result);
+                       sqlFreeResult($result);
 
                        // Prepare array for the template
                        $content['locked']     = addSelectionBox('yn', $content['locked']    , 'locked', $id);
-                       $content['hidden']     = addSelectionBox('yn', $content['hidden']    , 'hidden', $id);
                        $content['admin_only'] = addSelectionBox('yn', $content['admin_only'], 'admin' , $id);
                        $content['mem_only']   = addSelectionBox('yn', $content['mem_only']  , 'member', $id);
 
@@ -92,12 +102,11 @@ if (isFormSent('edit')) {
                $id = bigintval($id);
 
                // Update module
-               addSql(SQL_QUERY_ESC("UPDATE
+               addSql(sqlQueryEscaped("UPDATE
        `{?_MYSQL_PREFIX?}_mod_reg`
 SET
        `title`='%s',
        `locked`='%s',
-       `hidden`='%s',
        `admin_only`='%s',
        `mem_only`='%s'
 WHERE
@@ -106,7 +115,6 @@ LIMIT 1",
                        array(
                                postRequestElement('title', $id),
                                postRequestElement('locked', $id),
-                               postRequestElement('hidden', $id),
                                postRequestElement('admin', $id),
                                postRequestElement('member', $id),
                                $id
@@ -125,15 +133,20 @@ LIMIT 1",
 
 if (!ifPostContainsSelections()) {
        // Load module data (We do not need to check if there's at least one...)
-       $result = SQL_QUERY('SELECT
-       `id`, `module`, `locked`, `hidden`, `admin_only`, `title`, `mem_only`
+       $result = sqlQuery('SELECT
+       `id`,
+       `module`,
+       `locked`,
+       `admin_only`,
+       `title`,
+       `mem_only`
 FROM
        `{?_MYSQL_PREFIX?}_mod_reg`
 ORDER BY
        `module` ASC', __FILE__, __LINE__);
 
        $OUT = '';
-       while ($content = SQL_FETCHARRAY($result)) {
+       while ($content = sqlFetchArray($result)) {
                // Reset title to --- if it is NULL
                if (($content['module'] == 'index') || ($content['module'] == 'login')) {
                        // Add link to detail statistics
@@ -145,7 +158,7 @@ ORDER BY
        } // END - while
 
        // Free memory
-       SQL_FREERESULT($result);
+       sqlFreeResult($result);
 
        // Load main template
        loadTemplate('admin_list_mods', FALSE, $OUT);