************************************************************************/
// 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");
}
if (isset($_POST['ok']))
{
$cnt = 0;
- foreach ($_POST['cat'] as $cat=>$joined)
+ foreach ($_POST['cat'] as $cat => $joined)
{
if ($joined == "N") $cnt++;
}
}
if (isset($_POST['ok']))
{
- foreach ($_POST['cat'] as $cat=>$joined)
+ foreach ($_POST['cat'] as $cat => $joined)
{
switch ($joined)
{
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
{
while (list($id, $cat) = SQL_FETCHROW($result))
{
// Default he has not joined
- $JOINED_N = ' checked'; $JOINED_Y = "";
+ $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",
// 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=\"checked\""; $JOINED_N = ""; }
}
else
{
if (SQL_NUMROWS($result_user) == 1)
{
- $JOINED_Y = ' checked'; $JOINED_N = "";
+ $JOINED_Y = " checked=\"checked\""; $JOINED_N = "";
}
// Free memory