本文整理汇总了PHP中CForumNew::CanUserEditForum方法的典型用法代码示例。如果您正苦于以下问题:PHP CForumNew::CanUserEditForum方法的具体用法?PHP CForumNew::CanUserEditForum怎么用?PHP CForumNew::CanUserEditForum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CForumNew
的用法示例。
在下文中一共展示了CForumNew::CanUserEditForum方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ShowError
ShowError(GetMessage("F_ERROR_MESSAGES_NOT_FOUND"));
return false;
}
foreach ($arResult["TOPIC"] as $key => $val) {
$arResult["TOPIC"]["~" . $key] = $val;
$arResult["TOPIC"][$key] = htmlspecialcharsEx($val);
}
foreach ($arResult["FORUM"] as $key => $val) {
$arResult["FORUM"]["~" . $key] = $val;
$arResult["FORUM"][$key] = htmlspecialcharsEx($val);
}
/********************************************************************
Default values
********************************************************************/
$arParams["PERMISSION"] = ForumCurrUserPermissions($arParams["FID"]);
$arResult["USER"] = array("INFO" => array(), "PERMISSION" => $arParams["PERMISSION"], "RIGHTS" => array("EDIT" => CForumNew::CanUserEditForum($arParams["FID"], $USER->GetUserGroupArray(), $USER->GetID()) ? "Y" : "N", "MODERATE" => "Y"), "SUBSCRIBE" => array());
$arResult["MESSAGE"] = array();
$arResult["NEW_TOPIC"] = array("TOPIC" => array(), "FORUM" => array());
$arResult["VALUES"] = array();
$bVarsFromForm = false;
$arResult["TOPIC"]["read"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"], array("FID" => $arResult["FORUM"]["ID"], "TID" => $arResult["TOPIC"]["ID"], "MID" => "s"));
$arResult["FORUM"]["list"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $arResult["FORUM"]["ID"]));
$arResult["topic_search"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_TOPIC_SEARCH"], array());
$arResult["ERROR_MESSAGE"] = "";
$arResult["OK_MESSAGE"] = "";
$arResult["sessid"] = bitrix_sessid_post();
$arResult["ForumPrintIconsList"] = ForumPrintIconsList(7, "ICON_ID", intVal($_REQUEST["ICON_ID"]), GetMessage("FM_NO_ICON"), LANGUAGE_ID, $arParams["PATH_TO_ICON"]);
$parser = new forumTextParser(LANGUAGE_ID, $arParams["PATH_TO_SMILE"]);
$parser->MaxStringLen = $arParams["WORD_LENGTH"];
$parser->image_params["width"] = $arParams["IMAGE_SIZE"];
$parser->image_params["height"] = $arParams["IMAGE_SIZE"];
示例2: elseif
elseif (empty($arResult["ELEMENT"])):
ShowError(str_replace("#ELEMENT_ID#", $arParams["ELEMENT_ID"], GetMessage("F_ERR_EID_IS_NOT_EXIST")));
return false;
elseif ($arResult["USER"]["PERMISSION"] <= "A"):
return false;
endif;
/********************************************************************
Default values
********************************************************************/
$arResult["FORUM_TOPIC_ID"] = intval($arResult["ELEMENT"]["PROPERTY_FORUM_TOPIC_ID_VALUE"]);
$arResult["USER"]["RIGHTS"] = array(
"ADD_TOPIC" => CForumTopic::CanUserAddTopic($arParams["FORUM_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"], $arResult["FORUM"] ) ? "Y" : "N",
"MODERATE" => CForumNew::CanUserModerateForum($arParams["FORUM_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"]) == true ? "Y" : "N",
"EDIT" => CForumNew::CanUserEditForum($arParams["FORUM_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"]) ? "Y" : "N",
"ADD_MESSAGE" => CForumMessage::CanUserAddMessage($arResult["FORUM_TOPIC_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"]) ? "Y" : "N");
if ($USER->IsAuthorized())
{
$arResult["USER"]["SHOWED_NAME"] = $USER->GetLogin();
if ($_SESSION["FORUM"]["SHOW_NAME"] == "Y")
{
$arResult["USER"]["SHOWED_NAME"] = CUser::FormatName(
$arParams["NAME_TEMPLATE"],
array(
"NAME" => $USER->GetFirstName(),
"LAST_NAME" => $USER->GetLastName(),
"SECOND_NAME" => $USER->GetSecondName(),
"LOGIN" => $USER->GetLogin()),
true,
示例3: ShowError
/Main Params
********************************************************************/
if (empty($arResult["FORUM"])) {
ShowError(str_replace("#FORUM_ID#", $arParams["FORUM_ID"], GetMessage("F_ERR_FID_IS_NOT_EXIST")));
return false;
} elseif (empty($arResult["ELEMENT"])) {
ShowError(str_replace("#ELEMENT_ID#", $arParams["ELEMENT_ID"], GetMessage("F_ERR_EID_IS_NOT_EXIST")));
return false;
} elseif ($arResult["USER"]["PERMISSION"] <= "A") {
return false;
}
/********************************************************************
Default values
********************************************************************/
$arResult["FORUM_TOPIC_ID"] = intval($arResult["ELEMENT"]["PROPERTY_FORUM_TOPIC_ID_VALUE"]);
$arResult["USER"]["RIGHTS"] = array("ADD_TOPIC" => CForumTopic::CanUserAddTopic($arParams["FORUM_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"], $arResult["FORUM"]) ? "Y" : "N", "MODERATE" => CForumNew::CanUserModerateForum($arParams["FORUM_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"]) == true ? "Y" : "N", "EDIT" => CForumNew::CanUserEditForum($arParams["FORUM_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"]) ? "Y" : "N", "ADD_MESSAGE" => CForumMessage::CanUserAddMessage($arResult["FORUM_TOPIC_ID"], $arResult["USER"]["GROUPS"], $arResult["USER"]["ID"]) ? "Y" : "N");
if ($USER->IsAuthorized()) {
$arResult["USER"]["SHOWED_NAME"] = $USER->GetLogin();
if ($_SESSION["FORUM"]["SHOW_NAME"] == "Y") {
$arResult["USER"]["SHOWED_NAME"] = CUser::FormatName($arParams["NAME_TEMPLATE"], array("NAME" => $USER->GetFirstName(), "LAST_NAME" => $USER->GetLastName(), "SECOND_NAME" => $USER->GetSecondName(), "LOGIN" => $USER->GetLogin()), true, false);
}
}
$arResult["PANELS"] = array("MODERATE" => $arResult["USER"]["RIGHTS"]["MODERATE"], "DELETE" => $arResult["USER"]["RIGHTS"]["EDIT"]);
$arResult["SHOW_PANEL"] = in_array("Y", $arResult["PANELS"]) ? "Y" : "N";
// PARSER
$parser = new forumTextParser(LANGUAGE_ID);
$parser->image_params["width"] = $arParams["IMAGE_SIZE"];
$parser->image_params["height"] = $arParams["IMAGE_SIZE"];
$arResult["PARSER"] = $parser;
// FORUM
$arAllow = forumTextParser::GetFeatures($arResult["FORUM"]);
示例4: elseif
elseif (empty($arResult["FORUM"])):
ShowError(GetMessage("F_ERRROR_FORUM_NOT_FOUND"));
return false;
elseif (ForumCurrUserPermissions($arParams["FID"]) < "Q"):
$APPLICATION->AuthForm(GetMessage("F_NO_PERMS"));
return false;
endif;
/********************************************************************
Default params
********************************************************************/
$arParams["PERMISSION"] = ForumCurrUserPermissions($arParams["FID"]);
$arResult["USER"] = array(
"INFO" => array(),
"PERMISSION" => $arParams["PERMISSION"],
"RIGHTS" => array(
"EDIT" => CForumNew::CanUserEditForum($arParams["FID"], $USER->GetUserGroupArray(), $USER->GetID()) ? "Y" : "N"),
"SUBSCRIBE" => array());
$arResult["TOPIC"] = array();
$arResult["MESSAGE_LIST"] = array();
$arResult["MESSAGE"] = array(); // out of date
$arResult["SHOW_RESULT"] = "N";
$arResult["ERROR_MESSAGE"] = "";
$arResult["OK_MESSAGE"] = "";
$arResult["list"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_LIST"], array("FID" => $arParams["FID"]));
$arResult["read"] = CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_READ"],
array("FID" => $arParams["FID"], "TID" => $arParams["TID"], "MID" => "s"));
$arResult["URL"] = array(
"LIST" => $arResult["list"],
"~LIST" => CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_LIST"], array("FID" => $arParams["FID"])),
"READ" => $arResult["read"],
示例5: foreach
endforeach;
$arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] = "";
/************** Forum **********************************************/
foreach ($arResult["FORUM"] as $key => $val):
$arResult["FORUM"]["~".$key] = $val;
$arResult["FORUM"][$key] = htmlspecialcharsEx($val);
endforeach;
if ($arParams["SHOW_FIRST_POST"] == "N"):
$arParams["SHOW_FIRST_POST"] = ($arResult["FORUM"]["ALLOW_TOPIC_TITLED"] == "Y" ? "Y" : "N");
endif;
/************** Current User ***************************************/
$arResult["USER"]["SHOW_NAME"] = $GLOBALS["FORUM_STATUS_NAME"]["guest"];
$arResult["USER"]["RIGHTS"] = array(
"ADD_TOPIC" => CForumTopic::CanUserAddTopic($arParams["FID"], $arUserGroups, $USER->GetID(), $arResult["FORUM"]) ? "Y" : "N",
"MODERATE" => (CForumNew::CanUserModerateForum($arParams["FID"], $arUserGroups, $USER->GetID()) == true ? "Y" : "N"),
"EDIT" => CForumNew::CanUserEditForum($arParams["FID"], $arUserGroups, $USER->GetID()) ? "Y" : "N",
"ADD_MESSAGE" => CForumMessage::CanUserAddMessage($arParams["TID"], $arUserGroups, $USER->GetID()) ? "Y" : "N");
if ($USER->IsAuthorized()):
$arResult["USER"]["INFO"] = CForumUser::GetByUSER_ID($USER->GetParam("USER_ID"));
$arResult["USER"]["SHOW_NAME"] = $_SESSION["FORUM"]["SHOW_NAME"];
$arResult["USER"]["RANK"] = CForumUser::GetUserRank($USER->GetParam("USER_ID"), LANGUAGE_ID);
$arFields = array("USER_ID" => $USER->GetID(), "FORUM_ID" => $arParams["FID"], "TOPIC_ID" => $arParams["TID"], "SITE_ID" => SITE_ID);
$db_res = CForumSubscribe::GetList(array(), $arFields);
if ($db_res && $res = $db_res->Fetch())
$arResult["USER"]["SUBSCRIBE"][$res["ID"]] = $res;
$arResult["USER"]["RIGHTS"]["EDIT_MESSAGE"] = ($arResult["USER"]["RIGHTS"]["EDIT"] != "Y" ? $arResult["USER"]["RIGHTS"]["ADD_MESSAGE"] : "N");
else:
$arResult["USER"]["RIGHTS"]["EDIT_MESSAGE"] = "N";
endif;
$arResult["USER"]["RIGHTS"]["EDIT_OWN_POST"] = COption::GetOptionString("forum", "USER_EDIT_OWN_POST", "N");
/************** Edit panels info ***********************************/
示例6: foreach
if (!is_array($val)) {
$arResult["TOPIC"][$key] = $parser->wrap_long_words($arResult["TOPIC"][$key]);
}
}
$arResult["TOPIC"]["iLAST_TOPIC_MESSAGE"] = "";
/************** Forum **********************************************/
foreach ($arResult["FORUM"] as $key => $val) {
$arResult["FORUM"]["~" . $key] = $val;
$arResult["FORUM"][$key] = htmlspecialcharsEx($val);
}
if ($arParams["SHOW_FIRST_POST"] == "N") {
$arParams["SHOW_FIRST_POST"] = $arResult["FORUM"]["ALLOW_TOPIC_TITLED"] == "Y" ? "Y" : "N";
}
/************** Current User ***************************************/
$arResult["USER"]["SHOW_NAME"] = $GLOBALS["FORUM_STATUS_NAME"]["guest"];
$arResult["USER"]["RIGHTS"] = array("ADD_TOPIC" => CForumTopic::CanUserAddTopic($arParams["FID"], $arUserGroups, $USER->GetID(), $arResult["FORUM"]) ? "Y" : "N", "MODERATE" => CForumNew::CanUserModerateForum($arParams["FID"], $arUserGroups, $USER->GetID()) == true ? "Y" : "N", "EDIT" => CForumNew::CanUserEditForum($arParams["FID"], $arUserGroups, $USER->GetID()) ? "Y" : "N", "ADD_MESSAGE" => CForumMessage::CanUserAddMessage($arParams["TID"], $arUserGroups, $USER->GetID()) ? "Y" : "N");
if ($USER->IsAuthorized()) {
$arResult["USER"]["INFO"] = CForumUser::GetByUSER_ID($USER->GetParam("USER_ID"));
$arResult["USER"]["SHOW_NAME"] = $_SESSION["FORUM"]["SHOW_NAME"];
$arResult["USER"]["RANK"] = CForumUser::GetUserRank($USER->GetParam("USER_ID"), LANGUAGE_ID);
$arFields = array("USER_ID" => $USER->GetID(), "FORUM_ID" => $arParams["FID"], "TOPIC_ID" => $arParams["TID"], "SITE_ID" => SITE_ID);
$db_res = CForumSubscribe::GetList(array(), $arFields);
if ($db_res && ($res = $db_res->Fetch())) {
$arResult["USER"]["SUBSCRIBE"][$res["ID"]] = $res;
}
$arResult["USER"]["RIGHTS"]["EDIT_MESSAGE"] = $arResult["USER"]["RIGHTS"]["EDIT"] != "Y" ? $arResult["USER"]["RIGHTS"]["ADD_MESSAGE"] : "N";
} else {
$arResult["USER"]["RIGHTS"]["EDIT_MESSAGE"] = "N";
}
$arResult["USER"]["RIGHTS"]["EDIT_OWN_POST"] = COption::GetOptionString("forum", "USER_EDIT_OWN_POST", "N");
/************** Edit panels info ***********************************/