]> 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 3a7bbc9e04e4bdb43af54342170cbc0bc0b7ed27..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)
@@ -59,7 +59,7 @@ if ($cats > 0)
                {
                        if ($joined == "N") $cnt++;
                }
-               if (($cats - $cnt) < $_CONFIG['least_cats'])
+               if (($cats - $cnt) < getConfig('least_cats'))
                {
                        unset($_POST['ok']);
                        $LEAST = true;
@@ -71,14 +71,14 @@ if ($cats > 0)
                {
                        switch ($joined)
                        {
-                               case 'Y':
+                               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
                                        {
@@ -87,8 +87,8 @@ if ($cats > 0)
                                        }
                                        break;
 
-                               case 'N':
-                                       $sql = "DELETE LOW_PRIORITY FROM "._MYSQL_PREFIX."_user_cats WHERE userid=%s AND cat_id=%s LIMIT 1";
+                               case "N":
+                                       $sql = "DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_user_cats` WHERE userid=%s AND cat_id=%s LIMIT 1";
                                        break;
                        }
                        if (!empty($sql))
@@ -98,14 +98,14 @@ 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
        {
                if ($LEAST)
                {
                        // Also here we have to secure it... :(
-                       LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".$_CONFIG['least_cats']);
+                       LOAD_TEMPLATE("admin_settings_saved", true, CATS_LEAST.": ".getConfig('least_cats'));
                }
                // Put some data into constants for the template
                define('__ROWS', ($cats*2+4));
@@ -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);