die; } $FID = IntVal($arTopic["FORUM_ID"]); $arForum = CForumNew::GetByID($FID); if (!$arForum) { LocalRedirect("index.php"); die; } // Now $FID and $TID (and $MID if needed) have actual and coordinated values // Let's check if current user can can view this topic if (!CForumTopic::CanUserViewTopic($TID, $USER->GetUserGroupArray())) { $APPLICATION->AuthForm("Для просмотра темы введите ваши логин и пароль"); } // Let's init read labels CForumNew::InitReadLabels($FID, $USER->GetUserGroupArray()); CForumTopic::SetReadLabels($TID, $USER->GetUserGroupArray()); if ($GLOBALS["SHOW_FORUM_DEBUG_INFO"]) { $arForumDebugInfo[] = "<br><font color=\"#FF0000\">Initializing Variables: " . Round(getmicrotime() - $prexectime, 3) . " sec</font>"; } // ACTIONS: reply, open/close topic, moderate, etc. if ($GLOBALS["SHOW_FORUM_DEBUG_INFO"]) { $prexectime = getmicrotime(); } $strErrorMessage = ""; $strOKMessage = ""; $bVarsFromForm = false; if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["MESSAGE_TYPE"] == "REPLY") { $arFieldsG = array("POST_MESSAGE" => $_POST["POST_MESSAGE"], "AUTHOR_NAME" => $_POST["AUTHOR_NAME"], "AUTHOR_EMAIL" => $_POST["AUTHOR_EMAIL"], "USE_SMILES" => $_POST["USE_SMILES"], "ATTACH_IMG" => $_FILES["ATTACH_IMG"]); $MID = ForumAddMessage("REPLY", $FID, $TID, 0, $arFieldsG, $strErrorMessage, $strOKMessage); $MID = IntVal($MID); if ($MID > 0) {