本文整理汇总了PHP中forumTextParser::convert4mail方法的典型用法代码示例。如果您正苦于以下问题:PHP forumTextParser::convert4mail方法的具体用法?PHP forumTextParser::convert4mail怎么用?PHP forumTextParser::convert4mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类forumTextParser
的用法示例。
在下文中一共展示了forumTextParser::convert4mail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
continue;
} elseif (!array_key_exists("CACHE_PATH", $arComponentDescription)) {
continue;
}
$path = str_replace("//", "/", $componentRelativePath . "/user" . $arResult["MESSAGE"]["AUTHOR_ID"]);
if ($arComponentDescription["CACHE_PATH"] == "Y") {
$path = "/" . SITE_ID . $path;
}
if (!empty($path)) {
BXClearCache(true, $path);
}
}
if (!empty($arResult["MESSAGE"]["AUTHOR_EMAIL"])) {
$event = new CEvent();
$arSiteInfo = $event->GetSiteFieldsArray(SITE_ID);
$arFields = array("FROM_NAME" => $arResult["MESSAGE"]["~RECIPIENT_NAME"], "FROM_USER_ID" => $USER->GetId(), "FROM_EMAIL" => $arSiteInfo["DEFAULT_EMAIL_FROM"], "TO_NAME" => $arResult["MESSAGE"]["~AUTHOR_NAME"], "TO_USER_ID" => $arResult["MESSAGE"]["AUTHOR_ID"], "TO_EMAIL" => $arResult["MESSAGE"]["AUTHOR_EMAIL"], "SUBJECT" => $arNotification["POST_SUBJ"], "MESSAGE" => $parser->convert4mail($arNotification["POST_MESSAGE"]), "MESSAGE_DATE" => date("d.m.Y H:i:s"), "MESSAGE_LINK" => "http://" . SITE_SERVER_NAME . CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PM_READ"], array("FID" => "1", "MID" => $newMID)) . "\n");
if ($event->Send("NEW_FORUM_PRIVATE_MESSAGE", SITE_ID, $arFields)) {
$arOK[] = array("id" => "send", "text" => GetMessage("PM_NOTIFICATION_SEND"));
$arrVars = array("REQUEST_IS_READ" => "N");
CForumPrivateMessage::Update($arResult["MESSAGE"]["ID"], $arrVars);
}
}
}
}
if (empty($arError)) {
if (!empty($next)) {
LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_PM_READ"], array("FID" => $arParams["FID"], "MID" => $next["ID"])));
} else {
LocalRedirect(CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_PM_LIST"], array("FID" => $arParams["FID"])));
}
}
示例2: array
if ($MID1 > 0) {
$arResult["MESSAGE"] = CForumMessage::GetByID($MID1);
$arParams["TID"] = $arResult["MESSAGE"]["TOPIC_ID"];
$arParams["MID"] = $arResult["MESSAGE"]["ID"];
$sText = COption::GetOptionString("forum", "FILTER", "Y") == "Y" ? $arResult["MESSAGE"]["POST_MESSAGE_FILTER"] : $arResult["MESSAGE"]["POST_MESSAGE"];
$sURL = CComponentEngine::MakePathFromTemplate($arParams["~URL_TEMPLATES_MESSAGE"], array("UID" => $arParams["USER_ID"], "FID" => $arParams["FID"], "TID" => $arParams["TID"], "MID" => $arParams["MID"]));
if ($arParams['AUTOSAVE']) {
$arParams['AUTOSAVE']->Reset();
}
/************** Socialnetwork notification *************************/
$workgroups_path = "";
if ($arParams["MODE"] == "GROUP" && IsModuleInstalled("extranet")) {
$workgroups_path = COption::GetOptionString("socialnetwork", "workgroups_page", false, SITE_ID);
$workgroups_path = "#GROUPS_PATH#" . substr($arParams["~URL_TEMPLATES_MESSAGE"], strlen($workgroups_path), strlen($arParams["~URL_TEMPLATES_MESSAGE"]) - strlen($workgroups_path));
}
$arSonetFields = array("ENTITY_TYPE" => $arParams["MODE"] == "GROUP" ? SONET_ENTITY_GROUP : SONET_ENTITY_USER, "ENTITY_ID" => $arParams["MODE"] == "GROUP" ? $arParams["SOCNET_GROUP_ID"] : $arParams["USER_ID"], "EVENT_ID" => "forum", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $arResult["MESSAGE"]["AUTHOR_NAME"], GetMessage("SONET_FORUM_LOG_TEMPLATE")), "TITLE" => $arFieldsG["TITLE"], "MESSAGE" => $sText, "TEXT_MESSAGE" => $parser->convert4mail($sText), "URL" => $sURL, "PARAMS" => serialize(array("PATH_TO_MESSAGE" => CComponentEngine::MakePathFromTemplate(!empty($workgroups_path) ? $workgroups_path : $arParams["~URL_TEMPLATES_MESSAGE"], array("TID" => $arParams["TID"])), "PARSED" => "N")), "MODULE_ID" => false, "CALLBACK_FUNC" => false, "SOURCE_ID" => $MID1, "RATING_TYPE_ID" => "FORUM_TOPIC", "RATING_ENTITY_ID" => intval($arParams["TID"]));
if (intVal($arResult["MESSAGE"]["AUTHOR_ID"]) > 0) {
$arSonetFields["USER_ID"] = $arResult["MESSAGE"]["AUTHOR_ID"];
}
if ($arParams["MESSAGE_TYPE"] == "NEW") {
if ($arParams["MODE"] == "GROUP") {
CSocNetGroup::SetLastActivity($arParams["SOCNET_GROUP_ID"]);
}
$logID = CSocNetLog::Add($arSonetFields, false);
if (intval($logID) > 0) {
CSocNetLog::Update($logID, array("TMP_ID" => $logID));
CSocNetLogRights::SetForSonet($logID, $arSonetFields["ENTITY_TYPE"], $arSonetFields["ENTITY_ID"], "forum", "view", true);
CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
}
} elseif ($arParams["MESSAGE_TYPE"] == "EDIT") {
$dbRes = CSocNetLog::GetList(array(), array("EVENT_ID" => "forum", "SOURCE_ID" => $MID1), false, false, array("ID"));
示例3: SocnetLogMessageAdd
public static function SocnetLogMessageAdd($arParams, $arMessageFields, $action = "")
{
static $parser = null;
if ($parser == null) {
$parser = new forumTextParser();
}
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "LIST" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "SMILES" => "N", "UPLOAD" => "Y", "NL2BR" => "N", "TABLE" => "N", "ALIGN" => "N");
// $arParams["LOG_ID"], $arParams["LANG"] ....
$arFieldsForSocnet = array("ENTITY_TYPE" => SONET_ENTITY_GROUP, "ENTITY_ID" => $arParams["ENTITY_ID"], "EVENT_ID" => "forum", "=LOG_DATE" => !!$arMessageFields["DATE_CREATE"] ? $arMessageFields["DATE_CREATE"] : $GLOBALS["DB"]->CurrentTimeFunction(), "LOG_UPDATE" => !!$arMessageFields["POST_DATE"] ? $arMessageFields["POST_DATE"] : null, "TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $arMessageFields["AUTHOR_NAME"], CForumEmail::GetLangMessage("FORUM_MAIL_SOCNET_TITLE_TOPIC", $arParams["LANG"])), "TITLE" => $arMessageFields["TITLE"], "MESSAGE" => $parser->convert($arMessageFields["POST_MESSAGE"], $arAllow), "TEXT_MESSAGE" => $parser->convert4mail($arMessageFields["POST_MESSAGE"]), "URL" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("UID" => $arMessageFields["AUTHOR_ID"], "FID" => $arMessageFields["FORUM_ID"], "TID" => $arMessageFields["TOPIC_ID"], "TITLE_SEO" => $arMessageFields["TOPIC_ID"], "MID" => $arMessageFields["ID"])), "PARAMS" => serialize(array("PATH_TO_MESSAGE" => CComponentEngine::MakePathFromTemplate($arParams["URL_TEMPLATES_MESSAGE"], array("TID" => $arMessageFields["TOPIC_ID"])))), "MODULE_ID" => false, "CALLBACK_FUNC" => false, "SOURCE_ID" => $arMessageFields["ID"], "RATING_TYPE_ID" => "FORUM_TOPIC", "RATING_ENTITY_ID" => $arMessageFields["TOPIC_ID"]);
if ($arMessageFields["AUTHOR_ID"] > 0) {
$arFieldsForSocnet["USER_ID"] = $arMessageFields["AUTHOR_ID"];
}
$db_res = CForumFiles::GetList(array("ID" => "ASC"), array("MESSAGE_ID" => $arMessageFields["ID"]));
$ufFileID = array();
while ($res = $db_res->Fetch()) {
$ufFileID[] = $res["FILE_ID"];
}
$ufDocID = $GLOBALS["USER_FIELD_MANAGER"]->GetUserFieldValue("FORUM_MESSAGE", "UF_FORUM_MESSAGE_DOC", $arMessageFields["ID"], LANGUAGE_ID);
$logID = $arParams["LOG_ID"];
if ($logID <= 0) {
if (!empty($ufFileID)) {
$arFieldsForSocnet["UF_SONET_LOG_FILE"] = $ufFileID;
}
if ($ufDocID) {
$arFieldsForSocnet["UF_SONET_LOG_DOC"] = $ufDocID;
}
$logID = CSocNetLog::Add($arFieldsForSocnet, false);
if (intval($logID) > 0) {
CSocNetLog::Update($logID, array("TMP_ID" => $logID));
CSocNetLogRights::SetForSonet($logID, $arFieldsForSocnet["ENTITY_TYPE"], $arFieldsForSocnet["ENTITY_ID"], "forum", "view", true);
if ($action == "SEND_EVENT") {
CSocNetLog::SendEvent($logID, "SONET_NEW_EVENT", $logID);
}
}
}
if ($logID > 0 && $action == "ADD_COMMENT") {
if (!empty($ufFileID)) {
$arFieldsForSocnet["UF_SONET_COM_FILE"] = $ufFileID;
}
if ($ufDocID) {
$arFieldsForSocnet["UF_SONET_COM_DOC"] = $ufDocID;
}
$arFieldsForSocnet["LOG_ID"] = $logID;
$arFieldsForSocnet["RATING_TYPE_ID"] = "FORUM_POST";
$arFieldsForSocnet["RATING_ENTITY_ID"] = $arMessageFields["ID"];
$commentID = CSocNetLogComments::Add($arFieldsForSocnet);
CSocNetLog::CounterIncrement($commentID, false, false, "LC");
return $commentID;
}
return $logID;
}