- switch ($_GET['do'])
- {
- case "edit": // Change categories
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_cats SET cat='%s', visible='%s', sort=%d WHERE id=%d LIMIT 1",
- array($cat, $_POST['vis'][$id], $_POST['sort'][$id], $id), __FILE__, __LINE__);
- $TEXT = CATEGORIES_SAVED;
- break;
-
- case "del": // Delete categories
- $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_cats WHERE id=%d LIMIT 1",
- array($id), __FILE__, __LINE__);
- $result = SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE cat_id=%d",
- array($id), __FILE__, __LINE__);
- $TEXT = CATEGORIES_DELETED;
- break;
- }
+ 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",
+ array(
+ $cat,
+ postRequestElement('vis', $id),
+ postRequestElement('sort', $id),
+ $id
+ ), __FILE__, __LINE__);
+ $TEXT = getMessage('CATEGORIES_SAVED');
+ break;
+
+ case 'del': // Delete categories
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1",
+ array($id), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_cats` WHERE `cat_id`=%s",
+ array($id), __FILE__, __LINE__);
+ $TEXT = getMessage('CATEGORIES_DELETED');
+ break;
+ } // END - switch