query("SELECT room FROM ".C_MSG_TBL." WHERE type='".$new_room_type."' AND room='".$new_room."' LIMIT 1"); if ($DbLink->num_rows() != 0) { $what_room = "R1"; list($new_room) = $DbLink->next_record(); }; $DbLink->clean_results(); }; if ($new_room_type == "0") $what_room = ""; // Room must be created if ($what_room == "") { // Ensure the user is a registered one if (!isset($Error)) { $DbLink->query("SELECT count(*) FROM ".C_REG_TBL." WHERE username='$U'"); list($count) = $DbLink->next_record(); if ($count != 0) $what_room = "R2"; $DbLink->clean_results(); }; // Ensure there is no existing room with the same name but a different type // among rooms created by users if ($what_room == "R2") { $T1 = 1 - $new_room_type; $DbLink->query("SELECT count(*) FROM ".C_MSG_TBL." WHERE room = '".$new_room."' AND type = '$T1' LIMIT 1"); list($count) = $DbLink->next_record(); $DbLink->clean_results(); if($count != 0) { $Error = ($new_room_type == 0 ? L_ERR_ROM_3:L_ERR_ROM_4); $what_room = ""; }; }; }; // Ensure the user is not banished from the room he wants to enter in if (C_BANISH != "0" && (!isset($status) || $status != "a")) { $$what_room = $new_room; include("./lib/banish.lib.php3"); if ($IsBanished) { $what_room = ""; $Error = L_ERR_USR_20; }; }; // If the room can't be created if ($what_room == "") { if (!isset($Error)) $Error = L_ERR_USR_13; $IsCommand = false; } // Log into the new room else { ?>