]> git.mxchange.org Git - mailer.git/blobdiff - inc/modules/member/what-categories.php
Overall performance increased
[mailer.git] / inc / modules / member / what-categories.php
index 4f2a8ae2386033a3910bb971b4cfd861ff256534..68d3dcbc3929df7a6ed43cf1910ef654f45068a1 100644 (file)
  ************************************************************************/
 
 // Some security stuff...
-if (ereg(basename(__FILE__), $_SERVER['PHP_SELF']))
-{
+if (!defined('__SECURITY')) {
        $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
        require($INC);
-}
- elseif (!IS_LOGGED_IN())
-{
+} elseif (!IS_MEMBER()) {
        LOAD_URL("modules.php[13~?module=index");
 }
 
@@ -58,7 +55,7 @@ if ($cats > 0)
        if (isset($_POST['ok']))
        {
                $cnt = 0;
-               foreach ($_POST['cat'] as $cat=>$joined)
+               foreach ($_POST['cat'] as $cat => $joined)
                {
                        if ($joined == "N") $cnt++;
                }
@@ -70,7 +67,7 @@ if ($cats > 0)
        }
        if (isset($_POST['ok']))
        {
-               foreach ($_POST['cat'] as $cat=>$joined)
+               foreach ($_POST['cat'] as $cat => $joined)
                {
                        switch ($joined)
                        {
@@ -121,7 +118,7 @@ if ($cats > 0)
                while (list($id, $cat) = SQL_FETCHROW($result))
                {
                        // Default he has not joined
-                       $JOINED_N = ' checked'; $JOINED_Y = "";
+                       $JOINED_N = " 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",
@@ -130,13 +127,13 @@ if ($cats > 0)
                        // When we found an entry don't read it, just change the JOINED_x variables
                        if (isset($_POST['cat']))
                        {
-                               if ($_POST['cat'][$id] =='Y') { $JOINED_Y = ' checked'; $JOINED_N = ""; }
+                               if ($_POST['cat'][$id] =='Y') { $JOINED_Y = " checked"; $JOINED_N = ""; }
                        }
                         else
                        {
                                if (SQL_NUMROWS($result_user) == 1)
                                {
-                                       $JOINED_Y = ' checked'; $JOINED_N = "";
+                                       $JOINED_Y = " checked"; $JOINED_N = "";
                                }
 
                                // Free memory