本文整理汇总了PHP中blogTextParser::convert4mail方法的典型用法代码示例。如果您正苦于以下问题:PHP blogTextParser::convert4mail方法的具体用法?PHP blogTextParser::convert4mail怎么用?PHP blogTextParser::convert4mail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类blogTextParser
的用法示例。
在下文中一共展示了blogTextParser::convert4mail方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: UpdateLog
public static function UpdateLog($commentID, $arBlogUser, $arUser, $arComment, $arPost, $arParams)
{
if (!CModule::IncludeModule('socialnetwork'))
return;
$AuthorName = CBlogUser::GetUserName($arBlogUser["~ALIAS"], $arUser["~NAME"], $arUser["~LAST_NAME"], $arUser["~LOGIN"], $arUser["~SECOND_NAME"]);
$parserBlog = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
$text4message = $parserBlog->convert($arComment["POST_TEXT"], false, $arParams["IMAGES"], $arAllow, array("isSonetLog"=>true));
$text4mail = $parserBlog->convert4mail($arComment["POST_TEXT"], $arParams["IMAGES"]);
$arSoFields = Array(
"TITLE_TEMPLATE" => htmlspecialcharsback($AuthorName)." ".GetMessage("BLG_SONET_COMMENT_TITLE"),
"TITLE" => $arPost['~TITLE'],
"MESSAGE" => $text4message,
"TEXT_MESSAGE" => $text4mail
);
$dbRes = CSocNetLogComments::GetList(
array("ID" => "DESC"),
array(
"EVENT_ID" => array("blog_comment", "blog_comment_micro"),
"SOURCE_ID" => $commentID
),
false,
false,
array("ID")
);
while ($arRes = $dbRes->Fetch())
CSocNetLogComments::Update($arRes["ID"], $arSoFields);
}
示例2: array
if ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH || strlen($arFields["PUBLISH_STATUS"]) <= 0) {
$arFil = array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => $arPost["ID"]);
$dbRes = CSocNetLog::GetList(array("ID" => "DESC"), $arFil, false, false, array("ID", "TMP_ID"));
if ($arRes = $dbRes->Fetch()) {
$log_id = $arRes["ID"];
} else {
$arParamsNotify = array("bSoNet" => true, "UserID" => $arParams["USER_ID"], "allowVideo" => $arResult["allowVideo"], "bGroupMode" => $arResult["bGroupMode"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "PATH_TO_POST" => $arParams["PATH_TO_POST"], "SOCNET_GROUP_ID" => $arParams["SOCNET_GROUP_ID"], "user_id" => $user_id, "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"]);
$log_id = CBlogPost::Notify($arPost, $arBlog, $arParamsNotify);
}
$arImages = array();
$res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "Y", "COMMENT_ID" => $commentId));
while ($arImage = $res->Fetch()) {
$arImages[$arImage["ID"]] = $arImage["FILE_ID"];
}
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "TABLE" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
$text4mail = $parserBlog->convert4mail($_POST['comment'], $arImages);
if (intval($log_id) > 0) {
$text4message = $parserBlog->convert($_POST['comment'], false, $arImages, $arAllow, array("isSonetLog" => true));
$arFieldsForSocnet = array("ENTITY_TYPE" => SONET_ENTITY_USER, "ENTITY_ID" => $arBlog["OWNER_ID"], "EVENT_ID" => "blog_comment", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "URL" => $commentUrl, "MODULE_ID" => false, "SOURCE_ID" => $commentId, "LOG_ID" => $log_id, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => intval($commentId));
if (intval($user_id) > 0) {
$arFieldsForSocnet["USER_ID"] = $user_id;
}
$log_comment_id = CSocNetLogComments::Add($arFieldsForSocnet, false, false);
CSocNetLog::CounterIncrement($log_comment_id, false, false, "LC", CSocNetLogRights::CheckForUserAll($log_id));
}
$arPSR = CBlogPost::GetSocnetPerms($arPost["ID"]);
$arUsrS = array();
if (!empty($arPSR["U"])) {
foreach ($arPSR["U"] as $k => $v) {
$arUsrS[] = "U" . $k;
}
示例3: blogTextParser
}
}
if (strpos($commentUrl, "?") !== false) {
$commentUrl .= "&";
} else {
$commentUrl .= "?";
}
if (strlen($arFields["PUBLISH_STATUS"]) > 0 && $arFields["PUBLISH_STATUS"] != BLOG_PUBLISH_STATUS_PUBLISH) {
$commentAddedUrl = $commentUrl . $arParams["COMMENT_ID_VAR"] . "=" . $commentID . "&hidden_add_comment_id=" . $commentID;
}
$commentUrl .= $arParams["COMMENT_ID_VAR"] . "=" . $commentID . "#" . $commentID;
if (strlen($AuthorName) <= 0) {
$AuthorName = $arFields["AUTHOR_NAME"];
}
$IdeaParser = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$arNotifyFields = array_merge($arFields, array("TYPE" => 'IDEA_COMMENT', "ACTION" => 'ADD', "ID" => $commentID, "AUTHOR" => $AuthorName, "FULL_PATH" => "http://" . $serverName . $commentUrl, "IDEA_COMMENT_TEXT" => $IdeaParser->convert4mail($arFields["POST_TEXT"]), "IDEA_TITLE" => $arPost['~TITLE']));
//Notifications
$Notify = CIdeaManagment::getInstance()->Notification($arNotifyFields);
//Socialnetwork notification
$Notify->getSonetNotify()->Send();
//Email notification
$Notify->getEmailNotify()->Send();
//END -> Notifications
if ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH || strlen($arFields["PUBLISH_STATUS"]) <= 0) {
if (!$bSoNet && $arFields["PARENT_ID"] > 0) {
$arPrev = CBlogComment::GetByID($arFields["PARENT_ID"]);
$arPrev = CBlogTools::htmlspecialcharsExArray($arPrev);
if ($user_id != $arPrev['AUTHOR_ID']) {
$email = '';
$res = CUser::GetByID($arPrev['AUTHOR_ID']);
if ($arOwner = $res->GetNext()) {
示例4: OnAfterPhotoCommentAddBlog
//.........这里部分代码省略.........
$sAuthorName = GetMessage("SONET_PHOTO_LOG_GUEST");
if (intval($arElement["CREATED_BY"]) > 0) {
$rsUser = CUser::GetByID($arElement["CREATED_BY"]);
if ($arUser = $rsUser->Fetch()) {
$sAuthorName = CUser::FormatName(CSite::GetNameFormat(false), $arUser, true, false);
}
}
if (in_array($this->entity_type, array(SONET_ENTITY_USER, SONET_ENTITY_GROUP)) && intval($this->entity_id) > 0) {
$entity_type = $this->entity_type;
$entity_id = $this->entity_id;
$alias = ($this->entity_type == SONET_ENTITY_GROUP ? "group" : "user") . "_" . $this->entity_id;
}
$arLogParams = array("BLOG_ID" => intval($this->BlogID));
$rsIBlock = CIBlock::GetByID($arElement["IBLOCK_ID"]);
if ($arIBlock = $rsIBlock->Fetch()) {
$arLogParams["IBLOCK_ID"] = $arIBlock["ID"];
$arLogParams["IBLOCK_TYPE"] = $arIBlock["IBLOCK_TYPE_ID"];
}
$rsSection = CIBlockSection::GetByID($arElement["IBLOCK_SECTION_ID"]);
if ($arSection = $rsSection->Fetch()) {
$arLogParams["SECTION_ID"] = $arSection["ID"];
$arLogParams["SECTION_NAME"] = $arSection["NAME"];
$arLogParams["SECTION_URL"] = str_replace("#SECTION_ID#", $arSection["ID"], $this->arPath["SECTION_URL"]);
$arSectionPath = array();
$bPassword = false;
$dbSectionPath = CIBlockSection::GetList(array("LEFT_MARGIN" => "ASC"), array("IBLOCK_ID" => intval($arLogParams["IBLOCK_ID"]), "<=LEFT_BORDER" => intval($arSection["LEFT_MARGIN"]), ">=RIGHT_BORDER" => intval($arSection["RIGHT_MARGIN"]), "<=DEPTH_LEVEL" => intval($arSection["DEPTH_LEVEL"])), false, array("ID", "IBLOCK_ID", "NAME", "CREATED_BY", "DEPTH_LEVEL", "LEFT_MARGIN", "RIGHT_MARGIN", "UF_PASSWORD"));
while ($arPath = $dbSectionPath->Fetch()) {
$arSectionPath[] = $arPath;
if (strlen(trim($arPath["UF_PASSWORD"])) > 0) {
$bPassword = true;
break;
}
}
if (!$alias) {
$entity_type = SONET_ENTITY_USER;
$entity_id = $arSectionPath[0]["CREATED_BY"];
$alias = $arSectionPath[0]["CODE"];
}
}
$arLogParams["ALIAS"] = $alias;
$arSonetFields = array("ENTITY_TYPE" => $entity_type, "ENTITY_ID" => $entity_id, "EVENT_ID" => "photo_photo", "LOG_DATE" => $arElement["TIMESTAMP_X"], "TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $sAuthorName, GetMessage("SONET_PHOTOPHOTO_LOG_1")), "TITLE" => $arElement["NAME"], "MESSAGE" => "", "TEXT_MESSAGE" => "", "URL" => CComponentEngine::MakePathFromTemplate($url, array("ELEMENT_ID" => $arElement["ID"], "element_id" => $arElement["ID"], "SECTION_ID" => $arElement["IBLOCK_SECTION_ID"], "section_id" => $arElement["IBLOCK_SECTION_ID"])), "MODULE_ID" => false, "CALLBACK_FUNC" => false, "SOURCE_ID" => $arElement["ID"], "PARAMS" => serialize($arLogParams), "RATING_TYPE_ID" => "IBLOCK_ELEMENT", "RATING_ENTITY_ID" => $arElement["ID"]);
if (intval($arElement["CREATED_BY"]) > 0) {
$arSonetFields["USER_ID"] = $arElement["CREATED_BY"];
}
$log_id = CSocNetLog::Add($arSonetFields, false);
if (intval($log_id) > 0) {
$log_title = $arSonetFields["TITLE"];
$log_url = $arSonetFields["URL"];
$log_section_name = $arLogParams["SECTION_NAME"];
$log_section_url = $arLogParams["SECTION_URL"];
$log_user_id = $arSonetFields["USER_ID"];
CSocNetLog::Update($log_id, array("TMP_ID" => $log_id));
if ($bPassword) {
CSocNetLogRights::DeleteByLogID($log_id);
CSocNetLogRights::Add($log_id, array("U" . $GLOBALS["USER"]->GetID(), "SA"));
} else {
CSocNetLogRights::SetForSonet($log_id, $entity_type, $entity_id, "photo", "view", true);
}
}
}
}
if (intval($log_id) > 0) {
$parserBlog = new blogTextParser(false, $this->arPath["PATH_TO_SMILE"]);
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
if ($bSocNetLogRecordExists) {
$text4message = $parserBlog->convert($arFields["POST_TEXT"], true, array(), $arAllow);
$text4mail = $parserBlog->convert4mail($arFields["POST_TEXT"]);
$arFieldsForSocnet = array("ENTITY_TYPE" => $entity_type, "ENTITY_ID" => $entity_id, "EVENT_ID" => "photo_comment", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "MODULE_ID" => false, "SOURCE_ID" => $ID, "LOG_ID" => $log_id, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => $ID);
if (intval($arFields["AUTHOR_ID"]) > 0) {
$arFieldsForSocnet["USER_ID"] = $arFields["AUTHOR_ID"];
}
$comment_id = CSocNetLogComments::Add($arFieldsForSocnet, false, false);
if ($comment_id) {
CSocNetLog::CounterIncrement($comment_id, false, false, "LC");
$arFieldsIM = array("TYPE" => "COMMENT", "TITLE" => $log_title, "MESSAGE" => $arFieldsForSocnet["MESSAGE"], "URL" => $log_url, "SECTION_NAME" => $log_section_name, "SECTION_URL" => $log_section_url, "ID" => $this->PhotoElementID, "PHOTO_AUTHOR_ID" => $log_user_id, "COMMENT_AUTHOR_ID" => $arFields["AUTHOR_ID"]);
CSocNetPhotoCommentEvent::NotifyIm($arFieldsIM);
}
} else {
$dbComments = CBlogComment::GetList(array(), array("BLOG_ID" => intval($this->BlogID), "POST_ID" => intval($this->PostID)), false, false, array("ID", "BLOG_ID", "POST_ID", "AUTHOR_ID", "POST_TEXT", "DATE_CREATE"));
while ($arComment = $dbComments->GetNext()) {
$text4message = $parserBlog->convert($arComment["POST_TEXT"], true, array(), $arAllow);
$text4mail = $parserBlog->convert4mail($arComment["POST_TEXT"]);
$arFieldsForSocnet = array("ENTITY_TYPE" => $entity_type, "ENTITY_ID" => $entity_id, "EVENT_ID" => "photo_comment", "=LOG_DATE" => $GLOBALS["DB"]->CharToDateFunction($arComment["DATE_CREATE"], "FULL", SITE_ID), "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "MODULE_ID" => false, "SOURCE_ID" => intval($arComment["ID"]), "LOG_ID" => $log_id, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => intval($arComment["ID"]));
if (intval($arFields["AUTHOR_ID"]) > 0) {
$arFieldsForSocnet["USER_ID"] = $arFields["AUTHOR_ID"];
}
$comment_id = CSocNetLogComments::Add($arFieldsForSocnet, false, false);
if ($comment_id) {
CSocNetLog::CounterIncrement($comment_id, false, false, "LC");
$arFieldsIM = array("TYPE" => "COMMENT", "TITLE" => $log_title, "MESSAGE" => $arFieldsForSocnet["MESSAGE"], "URL" => $log_url, "SECTION_NAME" => $log_section_name, "SECTION_URL" => $log_section_url, "ID" => $this->PhotoElementID, "PHOTO_AUTHOR_ID" => $log_user_id, "COMMENT_AUTHOR_ID" => $arFields["AUTHOR_ID"]);
CSocNetPhotoCommentEvent::NotifyIm($arFieldsIM);
}
}
if ($arElement) {
self::InheriteAlbumFollow($arElement["IBLOCK_SECTION_ID"], $log_id, intVal($arElement["CREATED_BY"]) > 0 ? $arElement["CREATED_BY"] : false);
}
}
}
}
}
示例5: BXClearCache
BXClearCache(True, "/" . SITE_ID . "/blog/" . $arBlog["URL"] . "/rss_out/" . $arPost["POST_ID"] . "/C/");
BXClearCache(True, "/" . SITE_ID . "/blog/last_messages/");
BXClearCache(True, "/" . SITE_ID . "/blog/commented_posts/");
BXClearCache(True, "/" . SITE_ID . "/blog/popular_posts/");
$images = array();
$res = CBlogImage::GetList(array("ID" => "ASC"), array("POST_ID" => $arPost["ID"], "BLOG_ID" => $arBlog["ID"], "IS_COMMENT" => "Y", "COMMENT_ID" => $commmentId));
while ($aImg = $res->Fetch()) {
$images[$aImg["ID"]] = $aImg["FILE_ID"];
}
$AuthorName = "";
if (IntVal($user_id) > 0) {
$AuthorName = CBlogUser::GetUserNameEx($arResult["arUser"], $arResult["BlogUser"], $arParams);
}
$parserBlog = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$arParserParams = array("imageWidth" => $arParams["IMAGE_MAX_WIDTH"], "imageHeight" => $arParams["IMAGE_MAX_HEIGHT"]);
$text4mail = $parserBlog->convert4mail($_POST['comment'], $images);
$serverName = defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0 ? SITE_SERVER_NAME : COption::GetOptionString("main", "server_name", "");
if (strlen($serverName) <= 0) {
$serverName = $_SERVER["SERVER_NAME"];
}
if (strpos($commentUrl, "?") !== false) {
$commentUrl .= "&";
} else {
$commentUrl .= "?";
}
if (strlen($arFields["PUBLISH_STATUS"]) > 0 && $arFields["PUBLISH_STATUS"] != BLOG_PUBLISH_STATUS_PUBLISH) {
$commentAddedUrl = $commentUrl . $arParams["COMMENT_ID_VAR"] . "=" . $commmentId . "&hidden_add_comment_id=" . $commmentId;
}
$commentUrl .= $arParams["COMMENT_ID_VAR"] . "=" . $commmentId . "#" . $commmentId;
if (!preg_match("/^[a-z]+:\\/\\//", $commentUrl)) {
$commentUrl = (CMain::IsHTTPS() ? 'https://' : 'http://') . $serverName . $commentUrl;
示例6: array
if (intval($logID) > 0) {
$socnetPerms = array("U1", "G2");
CSocNetLog::Update($logID, array("TMP_ID" => $logID));
CSocNetLogRights::DeleteByLogID($logID);
CSocNetLogRights::Add($logID, $socnetPerms);
}
}
foreach ($categoryID as $v) {
CBlogPostCategory::Add(array("BLOG_ID" => $blogID, "POST_ID" => $postID, "CATEGORY_ID" => $v));
}
$arBlogCommentFields = array("TITLE" => GetMessage("BLOG_DEMO_COMMENT_TITLE"), "POST_TEXT" => GetMessage("BLOG_DEMO_COMMENT_BODY"), "BLOG_ID" => $blogID, "POST_ID" => $postID, "PARENT_ID" => 0, "AUTHOR_ID" => 1, "DATE_CREATE" => ConvertTimeStamp(false, "FULL"), "AUTHOR_IP" => "192.168.0.108");
$commmentId = CBlogComment::Add($arBlogCommentFields);
if (CModule::IncludeModule("socialnetwork")) {
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
$text4message = $parserBlog->convert($arBlogCommentFields["POST_TEXT"], false, array(), $arAllow);
$text4mail = $parserBlog->convert4mail($arBlogCommentFields["POST_TEXT"]);
$arBlogUser = CBlogUser::GetByID(1, BLOG_BY_USER_ID);
$arBlogUser = CBlogTools::htmlspecialcharsExArray($arBlogUser);
$AuthorName = CBlogUser::GetUserName($arBlogUser["~ALIAS"], $arUser["~NAME"], $arUser["~LAST_NAME"], $arUser["~LOGIN"]);
$commentUrl = CComponentEngine::MakePathFromTemplate(WIZARD_SITE_DIR . "company/personal/user/#user_id#/blog/#post_id#/", array("post_id" => $postID, "user_id" => 1));
if (strpos($commentUrl, "?") !== false) {
$commentUrl .= "&";
} else {
$commentUrl .= "?";
}
$commentUrl .= "commentId=" . $commmentId . "#" . $commmentId;
$arSoFields = array("ENTITY_TYPE" => "U", "ENTITY_ID" => 1, "EVENT_ID" => "blog_comment", "=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "MESSAGE" => $text4message, "TEXT_MESSAGE" => $text4mail, "URL" => $commentUrl, "MODULE_ID" => false, "SOURCE_ID" => $commmentId, "USER_ID" => 1, "LOG_ID" => $logID, "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => intval($commmentId));
CSocNetLogComments::Add($arSoFields);
}
//CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH."/community/index.php", Array("SONET_GROUP_ID" => $SocNetGroupID));
CWizardUtil::ReplaceMacros(WIZARD_SITE_PATH . "/company/personal.php", array("BLOG_GROUP_ID" => $SocNetGroupID));
示例7: GetMessage
CBlogPostCategory::Add(array("BLOG_ID" => $arBlog["ID"], "POST_ID" => $newID, "CATEGORY_ID" => $v));
}
$DB->Query("UPDATE b_blog_image SET POST_ID=" . $newID . " WHERE BLOG_ID=" . $arBlog["ID"] . " AND POST_ID=0", true);
}
if (IntVal($newID) > 0 && strlen($arResult["ERROR_MESSAGE"]) <= 0) {
if ($arFields["ACTION"] == "ADD") {
$arResult["SUCCESS_MESSAGE"] = GetMessage("IDEA_NEW_MESSAGE_SUCCESS");
}
//Get Author Name
$arResult["BlogUser"] = CBlogUser::GetByID($arFields["AUTHOR_ID"], BLOG_BY_USER_ID);
$arResult["BlogUser"] = CBlogTools::htmlspecialcharsExArray($arResult["BlogUser"]);
$arResult["arUser"] = CUser::GetByID($arFields["AUTHOR_ID"])->GetNext();
$AuthorName = CBlogUser::GetUserName($arResult["BlogUser"]["~ALIAS"], $arResult["arUser"]["~NAME"], $arResult["arUser"]["~LAST_NAME"], $arResult["arUser"]["~LOGIN"]);
$IdeaParser = new blogTextParser(false, $arParams["PATH_TO_SMILE"]);
$arCategoryList = CIdeaManagment::getInstance()->Idea()->GetCategoryList();
$arNotifyFields = array_merge($arFields, array("AUTHOR" => $AuthorName, "IDEA_TEXT" => $IdeaParser->convert4mail($arFields["DETAIL_TEXT"]), "SHOW_RATING" => $arParams["SHOW_RATING"], "RATING_TYPE_ID" => 'BLOG_POST', "RATING_ENTITY_ID" => $newID, "ID" => $newID, "TYPE" => "IDEA", "CATEGORY" => $arCategoryList[$arFields[CIdeaManagment::UFCategroryCodeField]]["NAME"], "FULL_PATH" => "http://" . $serverName . CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arFields["PATH"]), array("post_id" => $newID)), "PATH" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arFields["PATH"]), array("post_id" => $newID))));
//Notifications
$Notify = CIdeaManagment::getInstance()->Notification($arNotifyFields);
//Socialnetwork notification
$Notify->getSonetNotify()->Send();
//Email notification
$Notify->getEmailNotify()->Send();
//Clear Caching and redirect
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/first_page/");
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/pages/");
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arBlog["ID"] . "/post/" . $newID . "/");
BXClearCache(True, '/' . SITE_ID . '/idea/statistic_list/');
//Redirect if not AJAX
if ($_REQUEST["AJAX"] != "Y") {
LocalRedirect($arNotifyFields["PATH"]);
}
示例8: OnAfterPhotoCommentAddBlog
//.........这里部分代码省略.........
"LOG_DATE" => $arElement["TIMESTAMP_X"],
"TITLE_TEMPLATE" => str_replace("#AUTHOR_NAME#", $sAuthorName, GetMessage("SONET_PHOTOPHOTO_LOG_1")),
"TITLE" => $arElement["NAME"],
"MESSAGE" => "",
"TEXT_MESSAGE" => "",
"URL" => CComponentEngine::MakePathFromTemplate($url, array(
"ELEMENT_ID" => $arElement["ID"],
"element_id" => $arElement["ID"],
"SECTION_ID" => $arElement["IBLOCK_SECTION_ID"],
"section_id" => $arElement["IBLOCK_SECTION_ID"]
)),
"MODULE_ID" => false,
"CALLBACK_FUNC" => false,
"SOURCE_ID" => $arElement["ID"],
"PARAMS" => serialize($arLogParams),
"RATING_TYPE_ID" => "IBLOCK_ELEMENT",
"RATING_ENTITY_ID"=> $arElement["ID"],
);
if (intval($arElement["CREATED_BY"]) > 0)
$arSonetFields["USER_ID"] = $arElement["CREATED_BY"];
$log_id = CSocNetLog::Add($arSonetFields, false);
if (intval($log_id) > 0)
{
CSocNetLog::Update($log_id, array("TMP_ID" => $log_id));
CSocNetLogRights::SetForSonet($log_id, $entity_type, $entity_id, "photo", "view", true);
}
}
}
if (intval($log_id) > 0)
{
$parserBlog = new blogTextParser(false, $this->arPath["PATH_TO_SMILE"]);
$arAllow = array("HTML" => "N", "ANCHOR" => "N", "BIU" => "N", "IMG" => "N", "QUOTE" => "N", "CODE" => "N", "FONT" => "N", "LIST" => "N", "SMILES" => "N", "NL2BR" => "N", "VIDEO" => "N");
if ($bSocNetLogRecordExists)
{
$text4message = $parserBlog->convert($arFields["POST_TEXT"], true, array(), $arAllow);
$text4mail = $parserBlog->convert4mail($arFields["POST_TEXT"]);
$arFieldsForSocnet = array(
"ENTITY_TYPE" => $entity_type,
"ENTITY_ID" => $entity_id,
"EVENT_ID" => "photo_comment",
"=LOG_DATE" => $GLOBALS["DB"]->CurrentTimeFunction(),
"MESSAGE" => $text4message,
"TEXT_MESSAGE" => $text4mail,
"MODULE_ID" => false,
"SOURCE_ID" => $ID,
"LOG_ID" => $log_id,
"RATING_TYPE_ID" => "BLOG_COMMENT",
"RATING_ENTITY_ID" => $ID,
);
if (intval($arFields["AUTHOR_ID"]) > 0)
$arFieldsForSocnet["USER_ID"] = $arFields["AUTHOR_ID"];
CSocNetLogComments::Add($arFieldsForSocnet);
}
else //socnetlog record didn't exist - adding all comments
{
$dbComments = CBlogComment::GetList(array(),
array(
"BLOG_ID" => intval($this->BlogID),
"POST_ID" => intval($this->PostID)
),
false,
false,
array("ID", "BLOG_ID", "POST_ID", "AUTHOR_ID", "POST_TEXT", "DATE_CREATE")
);
while ($arComment = $dbComments->GetNext())
{
$text4message = $parserBlog->convert($arComment["POST_TEXT"], true, array(), $arAllow);
$text4mail = $parserBlog->convert4mail($arComment["POST_TEXT"]);
$arFieldsForSocnet = array(
"ENTITY_TYPE" => $entity_type,
"ENTITY_ID" => $entity_id,
"EVENT_ID" => "photo_comment",
"=LOG_DATE" => $GLOBALS["DB"]->CharToDateFunction($arComment["DATE_CREATE"], "FULL", SITE_ID),
"MESSAGE" => $text4message,
"TEXT_MESSAGE" => $text4mail,
"MODULE_ID" => false,
"SOURCE_ID" => intval($arComment["ID"]),
"LOG_ID" => $log_id,
"RATING_TYPE_ID" => "BLOG_COMMENT",
"RATING_ENTITY_ID" => intval($arComment["ID"]),
);
if (intval($arFields["AUTHOR_ID"]) > 0)
$arFieldsForSocnet["USER_ID"] = $arFields["AUTHOR_ID"];
CSocNetLogComments::Add($arFieldsForSocnet);
}
}
}
}
}