本文整理匯總了PHP中CForumMessage::CanUserDeleteMessage方法的典型用法代碼示例。如果您正苦於以下問題:PHP CForumMessage::CanUserDeleteMessage方法的具體用法?PHP CForumMessage::CanUserDeleteMessage怎麽用?PHP CForumMessage::CanUserDeleteMessage使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CForumMessage
的用法示例。
在下文中一共展示了CForumMessage::CanUserDeleteMessage方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ForumMoveMessage2Support
function ForumMoveMessage2Support($MID, &$strErrorMessage, &$strOKMessage, $arAddParams = array())
{
global $USER;
$MID = IntVal($MID);
$sError = array();
$sNote = array();
$arAddParams = !is_array($arAddParams) ? array($arAddParams) : $arAddParams;
$arAddParams["PERMISSION"] = !empty($arAddParams["PERMISSION"]) ? $arAddParams["PERMISSION"] : false;
if ($MID <= 0) {
$arError[] = GetMessage("MOVEMES_NO_MESS_EX");
}
if (!CModule::IncludeModule("support")) {
$arError[] = GetMessage("MOVEMES_NO_SUPPORT");
}
if (empty($arError)) {
$arMessage = CForumMessage::GetByID($MID, array("FILTER" => "N"));
if (!$arMessage) {
$arError[] = GetMessage("MOVEMES_NO_MESS_EX");
} elseif (IntVal($arMessage["AUTHOR_ID"]) <= 0) {
$arError[] = GetMessage("MOVEMES_NO_ANONYM");
} elseif (!CForumMessage::CanUserDeleteMessage($MID, $USER->GetUserGroupArray(), $USER->GetID(), $arAddParams["PERMISSION"])) {
$arError[] = GetMessage("MOVEMES_NO_PERMS2MOVE");
} else {
$arTopic = CForumTopic::GetByID($arMessage["TOPIC_ID"]);
$arFieldsSu = array("CLOSE" => "N", "TITLE" => $arTopic["TITLE"], "MESSAGE" => $arMessage["POST_MESSAGE"], "OWNER_USER_ID" => $arMessage["AUTHOR_ID"], "OWNER_SID" => $arMessage["AUTHOR_NAME"], "SOURCE_SID" => "forum");
$arIMAGE = CFile::MakeFileArray($arMessage["ATTACH_IMG"]);
if (is_array($arIMAGE)) {
$arIMAGE["MODULE_ID"] = "support";
$arFieldsSu["FILES"] = array($arIMAGE);
}
$SuID = CTicket::SetTicket($arFieldsSu);
$SuID = IntVal($SuID);
if ($SuID > 0) {
$sNote[] = GetMessage("MOVEMES_SUCCESS_SMOVE");
} else {
$arError[] = GetMessage("MOVEMES_ERROR_SMOVE");
}
}
}
if (!empty($arError)) {
$strErrorMessage .= implode(".\n", $arError) . ".\n";
}
if (!empty($arNote)) {
$strOKMessage .= implode(".\n", $arNote) . ".\n";
}
if (empty($arError)) {
return $SuID;
} else {
return False;
}
}