當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CForumTopic::CanUserViewTopic方法代碼示例

本文整理匯總了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;
開發者ID:ASDAFF,項目名稱:bitrix-5,代碼行數:31,代碼來源:component.php

示例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);
         }
開發者ID:,項目名稱:,代碼行數:31,代碼來源:


注:本文中的CForumTopic::CanUserViewTopic方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。