本文整理汇总了PHP中CForumTopic::CanUserViewTopic方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumTopic::CanUserViewTopic方法的具体用法?PHP CForumTopic::CanUserViewTopic怎么用?PHP CForumTopic::CanUserViewTopic使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumTopic
的用法示例。
在下文中一共展示了CForumTopic::CanUserViewTopic方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intVal
}
}
if (empty($arResult["TOPIC"])):
elseif ($arResult["TOPIC"]["STATE"] == "L" && intVal($arResult["TOPIC"]["TOPIC_ID"]) > 0):
$res = CForumTopic::GetByIDEx($arResult["TOPIC"]["TOPIC_ID"], array("GET_FORUM_INFO" => "Y"));
if (empty($res)):
$arError = array(
"code" => "404",
"title" => GetMessage("F_ERROR_TID_IS_LOST"));
else:
$arResult["TOPIC"] = $res;
$arResult["FORUM"] = $res["FORUM_INFO"];
endif;
elseif (!CForumNew::CanUserViewForum($arResult["FORUM"]["ID"], $arUserGroups)):
$APPLICATION->AuthForm(GetMessage("F_FPERMS"));
elseif (!CForumTopic::CanUserViewTopic($arResult["TOPIC"]["ID"], $arUserGroups)):
// Topic is approve? For moderation forum.
$arError = array(
"code" => "tid_not_approved",
"title" => GetMessage("F_ERROR_TID_NOT_APPROVED"),
"link" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"],
array("FID" => $arParams["FID"])));
endif;
/********************************************************************
/Main Data & Permissions
********************************************************************/
if ($arError["code"] == "404"):
CHTTP::SetStatus("404 Not Found");
ShowError($arError["title"]);
return false;
示例2: ForumCurrUserPermissions
$bVarsFromForm = false;
$PermissionUser = ForumCurrUserPermissions($arForum["ID"]);
if ($PermissionUser < "E") {
$APPLICATION->AuthForm(GetMessage("FR_FPERMS"));
}
//*************************!Subscribe******************************************************************************
if ($_REQUEST["TOPIC_SUBSCRIBE"] == "Y" || $_REQUEST["FORUM_SUBSCRIBE"] == "Y") {
if ($_REQUEST["TOPIC_SUBSCRIBE"] == "Y") {
ForumSubscribeNewMessagesEx($FID, $TID, "N", $strErrorMessage, $strOKMessage);
}
if ($_REQUEST["FORUM_SUBSCRIBE"] == "Y") {
ForumSubscribeNewMessagesEx($FID, 0, "N", $strErrorMessage, $strOKMessage);
}
}
//*************************!Subscribe******************************************************************************
if (!CForumTopic::CanUserViewTopic($TID, $USER->GetUserGroupArray())) {
LocalRedirect("list.php?FID=" . $FID . "&TID=Y");
}
ForumSetLastVisit($FID, $TID);
ForumSetReadTopic($FID, $TID);
//*************************!Action*********************************************************************************
if ($_POST["MESSAGE_MODE"] != "VIEW" && (strLen(trim($_REQUEST["ACTION"])) > 0 || $_REQUEST["VOTE4USER"] == "Y" || $_POST["MESSAGE_TYPE"] == "REPLY") && check_bitrix_sessid()) {
if ($_SERVER["REQUEST_METHOD"] == "POST" && $_POST["MESSAGE_TYPE"] == "REPLY" && check_bitrix_sessid()) {
$arFieldsG = array("POST_MESSAGE" => $_POST["POST_MESSAGE"], "AUTHOR_NAME" => trim($_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, false, $_POST["captcha_word"], 0, $_POST["captcha_code"]);
$MID = IntVal($MID);
if ($MID <= 0) {
$bVarsFromForm = true;
} else {
LocalRedirect($APPLICATION->GetCurPage() . "?FID=" . $FID . "&TID=" . $TID . "&MID=" . $MID . "#message" . $MID);
}