15 if (!Main\Loader::includeModule(
"search") || $message[
"SERVICE_TYPE"] > 0)
20 if (Main\
Config\Option::get(
"forum",
"FILTER",
"Y") ==
"Y" && $message[
"POST_MESSAGE_FILTER"] !==
null)
22 $message[
"POST_MESSAGE"] = $message[
"POST_MESSAGE_FILTER"];
27 "SITE" => $forum->getSites(),
31 foreach ($forum->getPermissions() as $groupId => $permission)
39 $arParams[
"PERMISSION"][] = $groupId;
46 "LAST_MODIFIED" => $message[
"POST_DATE"],
47 "PARAM1" => $message[
"FORUM_ID"],
48 "PARAM2" => $message[
"TOPIC_ID"],
49 "ENTITY_TYPE_ID" => ($message[
"NEW_TOPIC"] ==
"Y"?
"FORUM_TOPIC":
"FORUM_POST"),
50 "ENTITY_ID" => ($message[
"NEW_TOPIC"] ==
"Y"? $message[
"TOPIC_ID"]: $message[
"ID"]),
51 "USER_ID" => $message[
"AUTHOR_ID"],
52 "PERMISSIONS" => $arParams[
"PERMISSION"],
53 "TITLE" => $topic[
"TITLE"].( $message[
"NEW_TOPIC"] ==
"Y" && !empty($topic[
"DESCRIPTION"]) ?
", ".$topic[
"DESCRIPTION"] :
""),
54 "TAGS" => ($message[
"NEW_TOPIC"] ==
"Y" ? $topic[
"TAGS"] :
""),
55 "BODY" => GetMessage(
"AVTOR_PREF").
" ".$message[
"AUTHOR_NAME"].
". ".(\CSearch::KillTags(\forumTextParser::clearAllTags($message[
"POST_MESSAGE"]))),
57 "INDEX_TITLE" => $message[
"NEW_TOPIC"] ==
"Y",
61 $arMentionedUserID = \CForumMessage::GetMentionedUserID($message[
"POST_MESSAGE"]);
62 if (!empty($arMentionedUserID))
64 $arSearchInd[
"PARAMS"] = array(
65 "mentioned_user_id" => $arMentionedUserID
70 "FORUM_ID" => $message[
"FORUM_ID"],
71 "TOPIC_ID" => $message[
"TOPIC_ID"],
72 "TITLE_SEO" => $topic[
"TITLE_SEO"],
73 "MESSAGE_ID" => $message[
"ID"],
74 "SOCNET_GROUP_ID" => $topic[
"SOCNET_GROUP_ID"],
75 "OWNER_ID" => $topic[
"OWNER_ID"],
76 "PARAM1" => $message[
"PARAM1"],
77 "PARAM2" => $message[
"PARAM2"]);
78 foreach ($arParams[
"SITE"] as $key => $val)
80 $arSearchInd[
"LID"][$key] = \CForumNew::PreparePath2Message($val, $urlPatterns);
81 if (empty($arSearchInd[
"URL"]) && !empty($arSearchInd[
"LID"][$key]))
82 $arSearchInd[
"URL"] = $arSearchInd[
"LID"][$key];
85 if (empty($arSearchInd[
"URL"]) && ($res = \CLang::GetByID(SITE_ID)->fetch()))
87 $arParams[
"DEFAULT_URL"] .= $res[
"DIR"].
88 Main\Config\Option::get(
"forum",
"REL_FPATH",
"").
89 "forum/read.php?FID=#FID#&TID=#TID#&MID=#MID##message#MID#";
90 $arSearchInd[
"URL"] = \CForumNew::PreparePath2Message($arParams[
"DEFAULT_URL"], $urlPatterns);
94 foreach(GetModuleEvents(
"forum",
"onMessageIsIndexed",
true) as $arEvent)
96 if (ExecuteModuleEventEx($arEvent, array($message[
"ID"], $message, &$arSearchInd)) ===
false)
105 \CSearch::Index(
"forum", $message[
"ID"], $arSearchInd,
true);