33 $topicId = (int)$topicId;
38 && Loader::includeModule(
'forum')
41 $res = MessageTable::getList(array(
42 'order' => array(
'ID' =>
'ASC'),
44 'TOPIC_ID' => $topicId,
46 'select' => array(
'ID')
48 if ($message = $res->fetch())
50 $messageId = $message[
'ID'];
54 $this->entityId = $messageId;
68 && Loader::includeModule(
'forum')
71 $res = MessageTable::getList(array(
75 'select' => array(
'ID',
'TOPIC_ID',
'POST_MESSAGE')
77 if ($message = $res->fetch())
83 'SOURCE_ID' => $messageId,
86 'select' => array(
'ID')
88 if ($logEntryFields = $res->fetch())
90 $logId = (int)$logEntryFields[
'ID'];
95 $res = \CSocNetLog::getList(
102 array(
'ID',
'EVENT_ID',
'URL'),
104 "CHECK_RIGHTS" =>
"Y",
106 "USE_SUBSCRIBE" =>
"N"
109 if ($logFields = $res->fetch())
113 'LOG_EVENT_ID' => $logFields[
'EVENT_ID'],
114 'URL' => $logFields[
'URL']
119 $res = TopicTable::getList(array(
121 '=ID' => $message[
'TOPIC_ID']
123 'select' => array(
'TITLE')
125 if ($topic = $res->fetch())
127 $title = htmlspecialcharsback($topic[
'TITLE']);
128 $title = \Bitrix\Socialnetwork\Helper\Mention::clear($title);
130 $CBXSanitizer = new \CBXSanitizer;
131 $CBXSanitizer->delAllTags();
132 $title = preg_replace(array(
"/\n+/is".BX_UTF_PCRE_MODIFIER,
"/\s+/is".BX_UTF_PCRE_MODIFIER),
" ", $CBXSanitizer->sanitizeHtml($title));