]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-categories.php
Previous fix fixed, a lot constants rewritten (unfinished)
[mailer.git] / inc / modules / member / what-categories.php
index 796eb90adfe55d29cadcf5fec4c087120576d203..ab5fc444b6288c50b8b73178bc40d2493adc789b 100644 (file)
@@ -43,10 +43,10 @@ if (!defined('__SECURITY')) {
 ADD_DESCR("member", __FILE__);
 
 $UID = $GLOBALS['userid'];
-$whereStatement = " WHERE visible='Y'";
+$whereStatement = " WHERE `visible`='Y'";
 if (IS_ADMIN()) $whereStatement = "";
 
-$result = SQL_QUERY("SELECT id, cat FROM "._MYSQL_PREFIX."_cats".$whereStatement." ORDER BY sort", __FILE__, __LINE__);
+$result = SQL_QUERY("SELECT id, cat FROM `{!_MYSQL_PREFIX!}_cats`".$whereStatement." ORDER BY `sort`", __FILE__, __LINE__);
 $cats = SQL_NUMROWS($result);
 
 if ($cats > 0)
@@ -73,12 +73,12 @@ if ($cats > 0)
                        {
                                case "Y":
                                        $sql = "";
-                                       $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1",
+                                       $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
                                         array($UID, bigintval($cat)), __FILE__, __LINE__);
 
                                        if (SQL_NUMROWS($result_user) == 0)
                                        {
-                                               $sql = "INSERT INTO "._MYSQL_PREFIX."_user_cats (userid, cat_id) VALUES ('%s','%s')";
+                                               $sql = "INSERT INTO `{!_MYSQL_PREFIX!}_user_cats` (userid, cat_id) VALUES ('%s','%s')";
                                        }
                                         else
                                        {
@@ -88,7 +88,7 @@ if ($cats > 0)
                                        break;
 
                                case "N":
-                                       $sql = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1";
+                                       $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1";
                                        break;
                        }
                        if (!empty($sql))
@@ -98,7 +98,7 @@ if ($cats > 0)
                        }
                }
                // Categories saved...
-               LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_CATS_SAVED);
+               LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_CATS_SAVED'));
        }
         else
        {
@@ -121,7 +121,7 @@ if ($cats > 0)
                        $JOINED_N = " checked=\"checked\""; $JOINED_Y = "";
 
                        // Check category selection
-                       $result_user = SQL_QUERY_ESC("SELECT id FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1",
+                       $result_user = SQL_QUERY_ESC("SELECT id FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1",
                         array($UID, bigintval($id)), __FILE__, __LINE__);
 
                        // When we found an entry don't read it, just change the JOINED_x variables
@@ -161,7 +161,7 @@ if ($cats > 0)
  else
 {
        // No cateogries are defined yet
-       LOAD_TEMPLATE("admin_settings_saved", true, MEMBER_NO_CATS);
+       LOAD_TEMPLATE("admin_settings_saved", true, getMessage('MEMBER_NO_CATS'));
 }
 
 SQL_FREERESULT($result);