9 const UF_NAME =
'UF_BLOG_COMMENT_DOC';
118 foreach(
GetModuleEvents(
"blog",
"OnBeforeCommentDelete",
true) as $arEvent)
127 "UPDATE b_blog_comment SET ".
128 " PARENT_ID = ".((intval(
$arResult[
"PARENT_ID"]) > 0) ? intval(
$arResult[
"PARENT_ID"]) :
"null").
" ".
129 "WHERE PARENT_ID = ".
$ID.
" ".
130 " AND BLOG_ID = ".intval(
$arResult[
"BLOG_ID"]).
" ".
131 " AND POST_ID = ".intval(
$arResult[
"POST_ID"]).
" ",
136 "=NUM_COMMENTS_ALL" =>
"NUM_COMMENTS_ALL - 1"
140 $updateFields[
"=NUM_COMMENTS"] =
"NUM_COMMENTS - 1";
145 while($aImg =
$res->Fetch())
151 unset(
$GLOBALS[
"BLOG_COMMENT"][
"BLOG_COMMENT_CACHE_".
$ID]);
156 if (CModule::IncludeModule(
"search"))
166 return $DB->Query(
"DELETE FROM b_blog_comment WHERE ID = ".
$ID.
"",
true);
176 if (isset(
$GLOBALS[
"BLOG_COMMENT"][
"BLOG_COMMENT_CACHE_".
$ID]) && is_array(
$GLOBALS[
"BLOG_COMMENT"][
"BLOG_COMMENT_CACHE_".
$ID]) &&
is_set(
$GLOBALS[
"BLOG_COMMENT"][
"BLOG_COMMENT_CACHE_".
$ID],
"ID"))
178 return $GLOBALS[
"BLOG_COMMENT"][
"BLOG_COMMENT_CACHE_".$ID];
183 "SELECT C.ID, C.BLOG_ID, C.POST_ID, C.PARENT_ID, C.AUTHOR_ID, C.AUTHOR_NAME, ".
184 " C.AUTHOR_EMAIL, C.AUTHOR_IP, C.AUTHOR_IP1, C.TITLE, C.POST_TEXT, ".
185 " ".$DB->DateToCharFunction(
"C.DATE_CREATE",
"FULL").
" as DATE_CREATE, ".
186 " C.PUBLISH_STATUS, C.PATH, C.SHARE_DEST ".
187 "FROM b_blog_comment C ".
188 "WHERE C.ID = ".$ID.
"";
200 public static function BuildRSS($postID, $blogID,
$type =
"RSS2.0", $numPosts = 10, $arPathTemplate = Array())
204 $blogID = intval($blogID);
205 $postID = intval($postID);
210 $numPosts = intval($numPosts);
211 $type = mb_strtolower(preg_replace(
"/[^a-zA-Z0-9.]/is",
"",
$type));
218 if ($arBlog && $arBlog[
"ACTIVE"] ==
"Y" && $arBlog[
"ENABLE_RSS"] ==
"Y")
221 if($arGroup[
"SITE_ID"] ==
SITE_ID)
224 if(!empty($arPost) && $arPost[
"BLOG_ID"] == $arBlog[
"ID"] && $arPost[
"ENABLE_COMMENTS"] ==
"Y")
227 $nowISO = date(
"Y-m-d\TH:i:s").mb_substr(date(
"O"), 0, 3).
":".mb_substr(date(
"O"), -2, 2);
232 $dbSite = CSite::GetList(
"sort",
"asc",
array(
"LID" =>
SITE_ID));
233 if ($arSite = $dbSite->Fetch())
235 $serverName = $arSite[
"SERVER_NAME"];
236 $charset = $arSite[
"CHARSET"];
237 $language = $arSite[
"LANGUAGE_ID"];
240 if ($serverName ==
'')
242 if (defined(
"SITE_SERVER_NAME") && SITE_SERVER_NAME <>
'')
243 $serverName = SITE_SERVER_NAME;
245 $serverName = COption::GetOptionString(
"main",
"server_name",
"");
254 $charset =
"windows-1251";
257 if($arPathTemplate[
"PATH_TO_BLOG"] <>
'')
258 $blogURL =
"http://".$serverName.htmlspecialcharsbx(CComponentEngine::MakePathFromTemplate($arPathTemplate[
"PATH_TO_BLOG"],
array(
"blog" => $arBlog[
"URL"],
"user_id" => $arBlog[
"OWNER_ID"],
"group_id" => $arBlog[
"SOCNET_GROUP_ID"])));
260 $blogURL =
"http://".$serverName.htmlspecialcharsbx(
CBlog::PreparePath($arBlog[
"URL"], $arGroup[
"SITE_ID"]));
262 if($arPathTemplate[
"PATH_TO_POST"] <>
'')
263 $url =
"http://".$serverName.htmlspecialcharsbx(CComponentEngine::MakePathFromTemplate($arPathTemplate[
"PATH_TO_POST"],
array(
"blog" => $arBlog[
"URL"],
"post_id" =>
CBlogPost::GetPostID($arPost[
"ID"], $arPost[
"CODE"], $arPathTemplate[
"ALLOW_POST_CODE"]),
"user_id" => $arBlog[
"OWNER_ID"],
"group_id" => $arBlog[
"SOCNET_GROUP_ID"])));
267 $dbUser = CUser::GetByID($arPost[
"AUTHOR_ID"]);
268 $arUser = $dbUser->Fetch();
270 if($arPathTemplate[
"USE_SOCNET"] ==
"Y")
280 if (
$type ==
"rss.92")
282 $rssText .=
"<".
"?xml version=\"1.0\" encoding=\"".$charset.
"\"?".
">\n\n";
283 $rssText .=
"<rss version=\".92\">\n";
284 $rssText .=
" <channel>\n";
285 $rssText .=
" <title>".$blogName.
"</title>\n";
286 $rssText .=
" <description>".$blogName.
"</description>\n";
287 $rssText .=
" <link>".$url.
"</link>\n";
288 $rssText .=
" <language>".$language.
"</language>\n";
289 $rssText .=
" <docs>http://backend.userland.com/rss092</docs>\n";
294 $rssText .=
"<".
"?xml version=\"1.0\" encoding=\"".$charset.
"\"?".
">\n\n";
295 $rssText .=
"<rss version=\"2.0\">\n";
296 $rssText .=
" <channel>\n";
297 $rssText .=
" <title>".$blogName.
"</title>\n";
298 $rssText .=
" <description>".$blogName.
"</description>\n";
300 $rssText .=
" <link>".$url.
"</link>\n";
301 $rssText .=
" <language>".$language.
"</language>\n";
302 $rssText .=
" <docs>http://backend.userland.com/rss2</docs>\n";
303 $rssText .=
" <pubDate>".$now.
"</pubDate>\n";
308 $atomID =
"tag:".$serverName.
",".date(
"Y-m-d").
":".$postID;
310 $rssText .=
"<".
"?xml version=\"1.0\" encoding=\"".$charset.
"\"?".
">\n\n";
311 $rssText .=
"<feed version=\"0.3\" xmlns=\"http://purl.org/atom/ns#\" xml:lang=\"".$language.
"\">\n";
312 $rssText .=
" <title>".$blogName.
"</title>\n";
313 $rssText .=
" <tagline>".$url.
"</tagline>\n";
314 $rssText .=
" <id>".$atomID.
"</id>\n";
315 $rssText .=
" <link rel=\"alternate\" type=\"text/html\" href=\"".$url.
"\" />\n";
316 $rssText .=
" <modified>".$nowISO.
"</modified>\n";
319 $authorP = htmlspecialcharsex(
CBlogUser::GetUserName($BlogUser[
"ALIAS"], $arUser[
"NAME"], $arUser[
"LAST_NAME"], $arUser[
"LOGIN"], $arUser[
"SECOND_NAME"]));
320 if($arPathTemplate[
"PATH_TO_USER"] <>
'')
321 $authorURLP =
"http://".$serverName.htmlspecialcharsbx(CComponentEngine::MakePathFromTemplate($arPathTemplate[
"PATH_TO_USER"],
array(
"user_id"=>$arPost[
"AUTHOR_ID"])));
323 $authorURLP =
"http://".$serverName.htmlspecialcharsbx(
CBlogUser::PreparePath($arPost[
"AUTHOR_ID"], $arGroup[
"SITE_ID"]));
325 $rssText .=
" <author>\n";
326 $rssText .=
" <name>".$authorP.
"</name>\n";
327 $rssText .=
" <uri>".$authorURLP.
"</uri>\n";
328 $rssText .=
" </author>\n";
333 $user_id =
$USER->GetID();
334 if($arPathTemplate[
"USE_SOCNET"] ==
"Y")
346 $arParserParams = Array(
347 "imageWidth" => $arPathTemplate[
"IMAGE_MAX_WIDTH"],
348 "imageHeight" => $arPathTemplate[
"IMAGE_MAX_HEIGHT"],
351 CTimeZone::Disable();
353 array(
"DATE_CREATE" =>
"DESC"),
356 "POST_ID" => $postID,
360 array(
"nTopCount" => $numPosts),
361 array(
"ID",
"TITLE",
"DATE_CREATE",
"POST_TEXT",
"AUTHOR_EMAIL",
"AUTHOR_ID",
"AUTHOR_NAME",
"USER_LOGIN",
"USER_LAST_NAME",
"USER_SECOND_NAME",
"USER_NAME",
"BLOG_USER_ALIAS")
365 $dbImages =
CBlogImage::GetList(Array(), Array(
"BLOG_ID" => $blogID,
"POST_ID" => $postID,
"IS_COMMENT" =>
"Y",
"!COMMENT_ID" =>
false));
366 while($arI = $dbImages->Fetch())
367 $arImages[$arI[
"ID"]] = $arI[
"FILE_ID"];
369 while ($arComments = $dbComments->Fetch())
371 $arDate =
ParseDateTime($arComments[
"DATE_CREATE"], CSite::GetDateFormat(
"FULL", $arGroup[
"SITE_ID"]));
372 $date = date(
"r", mktime($arDate[
"HH"], $arDate[
"MI"], $arDate[
"SS"], $arDate[
"MM"], $arDate[
"DD"], $arDate[
"YYYY"]));
374 if(mb_strpos(
$url,
"?") !==
false)
375 $url1 =
$url.
"&";
378 $url1 .=
"commentId=".$arComments[
"ID"].
"#com".$arComments[
"ID"];
381 if(intval($arComments[
"AUTHOR_ID"]) > 0)
383 $author =
CBlogUser::GetUserName($arComments[
"BLOG_USER_ALIAS"], $arComments[
"USER_NAME"], $arComments[
"USER_LAST_NAME"], $arComments[
"USER_LOGIN"], $arComments[
"USER_SECOND_NAME"]);
384 if($arPathTemplate[
"PATH_TO_USER"] <>
'')
385 $authorURL =
"http://".$serverName.htmlspecialcharsbx(CComponentEngine::MakePathFromTemplate($arPathTemplate[
"PATH_TO_USER"],
array(
"user_id"=>$arComments[
"AUTHOR_ID"])));
387 $authorURL =
"http://".$serverName.htmlspecialcharsbx(
CBlogUser::PreparePath($arComments[
"AUTHOR_ID"], $arGroup[
"SITE_ID"]));
390 $author = $arComments[
"AUTHOR_NAME"];
391 $arAllow =
array(
"HTML" =>
"N",
"ANCHOR" =>
"Y",
"BIU" =>
"Y",
"IMG" =>
"Y",
"QUOTE" =>
"Y",
"CODE" =>
"Y",
"FONT" =>
"Y",
"LIST" =>
"Y",
"SMILES" =>
"Y",
"NL2BR" =>
"N",
"VIDEO" =>
"Y",
"TABLE" =>
"Y",
"CUT_ANCHOR" =>
"N");
392 if($arPathTemplate[
"NO_URL_IN_COMMENTS"] ==
"L" || (intval($arComments[
"AUTHOR_ID"]) <= 0 && $arPathTemplate[
"NO_URL_IN_COMMENTS"] ==
"A"))
393 $arAllow[
"CUT_ANCHOR"] =
"Y";
395 if($arPathTemplate[
"NO_URL_IN_COMMENTS_AUTHORITY_CHECK"] ==
"Y" && $arAllow[
"CUT_ANCHOR"] !=
"Y" && intval($arComments[
"AUTHOR_ID"]) > 0)
399 if($arRatingResult[
"CURRENT_VALUE"] < $arPathTemplate[
"NO_URL_IN_COMMENTS_AUTHORITY"])
400 $arAllow[
"CUT_ANCHOR"] =
"Y";
403 $text = $parser->convert_to_rss($arComments[
"POST_TEXT"], $arImages, $arAllow,
false, $arParserParams);
412 $text =
"<![CDATA[".$text.
"]]>";
415 if (
$type ==
"rss.92")
417 $rssText .=
" <item>\n";
418 $rssText .=
" <title>".$title.
"</title>\n";
419 $rssText .=
" <description>".$text.
"</description>\n";
420 $rssText .=
" <link>".$url1.
"</link>\n";
421 $rssText .=
" </item>\n";
426 $rssText .=
" <item>\n";
427 $rssText .=
" <title>".$title.
"</title>\n";
428 $rssText .=
" <description>".$text.
"</description>\n";
429 $rssText .=
" <link>".$url1.
"</link>\n";
430 $rssText .=
" <guid>".$url1.
"</guid>\n";
431 $rssText .=
" <pubDate>".$date.
"</pubDate>\n";
432 $rssText .=
" </item>\n";
437 $atomID =
"tag:".$serverName.
":".$arBlog[
"URL"].
"/".$arPost[
"ID"];
439 $timeISO = mktime($arDate[
"HH"], $arDate[
"MI"], $arDate[
"SS"], $arDate[
"MM"], $arDate[
"DD"], $arDate[
"YYYY"]);
440 $dateISO = date(
"Y-m-d\TH:i:s", $timeISO).mb_substr(date(
"O", $timeISO), 0, 3).
":".mb_substr(date(
"O", $timeISO), -2, 2);
442 $rssText .=
"<entry>\n";
443 $rssText .=
" <title type=\"text/html\">".$title.
"</title>\n";
444 $rssText .=
" <link rel=\"alternate\" type=\"text/html\" href=\"".$url1.
"\"/>\n";
445 $rssText .=
" <issued>".$dateISO.
"</issued>\n";
446 $rssText .=
" <modified>".$nowISO.
"</modified>\n";
447 $rssText .=
" <id>".$atomID.
"</id>\n";
448 $rssText .=
" <content type=\"text/html\" mode=\"escaped\" xml:lang=\"".$language.
"\" xml:base=\"".$blogURL.
"\">\n";
449 $rssText .=
$text.
"\n";
450 $rssText .=
" </content>\n";
451 $rssText .=
" <author>\n";
452 $rssText .=
" <name>".htmlspecialcharsex($author).
"</name>\n";
454 $rssText .=
" <uri>".$authorURL.
"</uri>\n";
455 $rssText .=
" </author>\n";
456 $rssText .=
"</entry>\n";
462 if (
$type ==
"rss.92")
463 $rssText .=
" </channel>\n</rss>";
465 $rssText .=
" </channel>\n</rss>";
467 $rssText .=
"\n\n</feed>";
477 if(intval(
$arParams[
"BLOG_ID"]) <= 0 || intval(
$arParams[
"POST_ID"]) <= 0 || !CModule::IncludeModule(
"search"))
482 $dbComment =
CBlogComment::GetList(Array(), Array(
"BLOG_ID" =>
$arParams[
"BLOG_ID"],
"POST_ID" =>
$arParams[
"POST_ID"],
"PUBLISH_STATUS" =>
BLOG_PUBLISH_STATUS_PUBLISH),
false,
false, Array(
"ID",
"POST_ID",
"BLOG_ID",
"PUBLISH_STATUS",
"PATH",
"DATE_CREATE",
"POST_TEXT",
"TITLE",
"AUTHOR_ID"));
483 while($arComment = $dbComment->Fetch())
485 if($arComment[
"PATH"] <>
'')
486 $arComment[
"PATH"] = str_replace(
"#comment_id#", $arComment[
"ID"], $arComment[
"PATH"]);
488 $arComment[
"PATH"] = str_replace(
"#comment_id#", $arComment[
"ID"],
$arParams[
"PATH"]);
493 $arComment[
"POST_ID"],
501 $arSearchIndex =
array(
503 "LAST_MODIFIED" => $arComment[
"DATE_CREATE"],
504 "PARAM1" =>
"COMMENT",
505 "PARAM2" => $arComment[
"BLOG_ID"].
"|".$arComment[
"POST_ID"],
506 "PERMISSIONS" =>
array(2),
507 "TITLE" => $arComment[
"TITLE"],
509 "INDEX_TITLE" =>
false,
510 "USER_ID" => (intval($arComment[
"AUTHOR_ID"]) > 0) ? $arComment[
"AUTHOR_ID"] :
false,
511 "ENTITY_TYPE_ID" =>
"BLOG_COMMENT",
512 "ENTITY_ID" => $arComment[
"ID"],
516 $arSearchIndex[
"PERMISSIONS"] = $arSp;
517 if(!in_array(
"U".$arComment[
"AUTHOR_ID"], $arSearchIndex[
"PERMISSIONS"]))
518 $arSearchIndex[
"PERMISSIONS"][] =
"U".$arComment[
"AUTHOR_ID"];
523 foreach($arSp as
$perm)
525 if(mb_strpos(
$perm,
"SG") !==
false)
527 $sgIdTmp = str_replace(
"SG",
"", mb_substr(
$perm, 0, mb_strpos(
$perm,
"_")));
528 if(!in_array($sgIdTmp, $sgId) && intval($sgIdTmp) > 0)
535 $arSearchIndex[
"PARAMS"] =
array(
536 "socnet_group" => $sgId,
537 "entity" =>
"socnet_group",
542 if($arComment[
"TITLE"] ==
'')
543 $arSearchIndex[
"TITLE"] = mb_substr($arSearchIndex[
"BODY"], 0, 100);
545 CSearch::Index(
"blog",
"C".$arComment[
"ID"], $arSearchIndex, True);
553 if (!CModule::IncludeModule(
'socialnetwork'))
559 $arBlogUser[
"~ALIAS"] ??
null,
560 $arUser[
"~NAME"] ??
null,
561 $arUser[
"~LAST_NAME"] ??
null,
562 $arUser[
"~LOGIN"] ??
null,
563 $arUser[
"~SECOND_NAME"] ??
null
567 $arAllow =
array(
"HTML" =>
"N",
"ANCHOR" =>
"N",
"BIU" =>
"N",
"IMG" =>
"N",
"QUOTE" =>
"N",
"CODE" =>
"N",
"FONT" =>
"N",
"LIST" =>
"N",
"SMILES" =>
"N",
"NL2BR" =>
"N",
"VIDEO" =>
"N");
568 $text4message = $parserBlog->convert($arComment[
"POST_TEXT"],
false,
$arParams[
"IMAGES"], $arAllow,
array(
"isSonetLog"=>
true));
569 $text4mail = $parserBlog->convert4mail($arComment[
"POST_TEXT"],
$arParams[
"IMAGES"]);
573 "TITLE" => $arPost[
'~TITLE'],
574 "MESSAGE" => $text4message,
575 "TEXT_MESSAGE" => $text4mail,
576 "TAG" => \
Bitrix\Socialnetwork\Util::detectTags($arComment,
array(
'POST_TEXT'))
580 array(
"ID" =>
"DESC"),
582 "EVENT_ID" =>
array(
"blog_comment",
"blog_comment_micro"),
583 "SOURCE_ID" => $commentID
597 if (!CModule::IncludeModule(
'socialnetwork'))
601 array(
"ID" =>
"DESC"),
603 "EVENT_ID" =>
array(
"blog_comment",
"blog_comment_micro"),
604 "SOURCE_ID" => $commentID
617 $entity_id = intval($entity_id);
621 if($entity_type ==
"G")
622 $type = $type2 =
"SG";
624 return $DB->Query(
"SELECT C.ID, C.POST_ID
625 FROM b_blog_comment C
626 INNER JOIN b_blog_socnet_rights SR ON (C.POST_ID = SR.POST_ID AND SR.ENTITY_TYPE='".
$type.
"' AND SR.ENTITY_ID=".$entity_id.
" AND SR.ENTITY = '".$type2.$entity_id.
"')");
631 $postID = intval($postID);
636 $sp = CBlogPost::GetSocnetPerms($postID);
637 if(is_array($sp) && !empty($sp))
639 foreach($sp as $et => $v)
641 foreach($v as $eid => $tv)
643 if($et ==
"U" && in_array($et.$eid, $tv))
647 elseif(in_array($et, Array(
"U",
"SG")))
649 $spt = CBlogPost::GetSocnetGroups(($et ==
"SG" ?
"G" :
"U"), $eid,
"view_comment");
652 if(!in_array($vv, $arSp))
677 if ($permsBySG ===
null)
691 $postId = intval($postId);
692 $authorId = intval($authorId);
700 $blogModulePermissions =
$APPLICATION->GetGroupRight(
"blog", ($bCurrent ?
false : CUser::GetUserGroup(
$userId)));
703 $blogModulePermissions >=
"W"
704 || ($bCurrent ? CSocNetUser::IsCurrentUserModuleAdmin() : CSocNetUser::IsUserModuleAdmin(
$userId))
708 $perms = key($AR_BLOG_PERMS);
709 reset($AR_BLOG_PERMS);
712 $arPerms = CBlogPost::GetSocNetPerms($postId);
713 $arGroupsId =
array();
715 !empty($arPerms[
"SG"])
716 && is_array($arPerms[
"SG"])
719 foreach($arPerms[
"SG"] as $gid =>
$val)
722 $arGroupsId[] = $gid;
737 $arEntities = Array();
749 preg_match(
'/^DR([0-9]+)/',
$code, $match)
750 || preg_match(
'/^D([0-9]+)/',
$code, $match)
751 || preg_match(
'/^IU([0-9]+)/',
$code, $match)
756 elseif (preg_match(
'/^SG([0-9]+)_([A-Z])/',
$code, $match))
758 $arEntities[
"SG"][$match[1]][$match[2]] = $match[2];
764 if (!empty($arEntities[
"DR"]) && !empty($arPerms[
"DR"]))
766 foreach($arPerms[
"DR"] as $id =>
$val)
768 if(isset($arEntities[
"DR"][
"DR".$id]))
778 foreach($arPerms[
"U"] as $id =>
$p)
780 if(in_array(
"US".$id,
$p))
799 !empty($arPerms[
"U"][$authorId])
800 && in_array(
"US".$authorId, $arPerms[
"U"][$authorId])
821 && !empty($arGroupsId)
824 $operation = Array(
"full_comment",
"moderate_comment",
"write_comment",
"premoderate_comment");
827 $operation[] =
"view_comment";
830 foreach ($operation as $v)
840 foreach(
$f as $gid =>
$val)
844 !empty($arEntities[
"SG"][$gid])
845 && in_array(
$val, $arEntities[
"SG"][$gid])
860 case "moderate_comment":
864 case "write_comment":
868 case "premoderate_comment":
890 $arMentionedUserID =
array();
894 preg_match_all(
"/\[user\s*=\s*([^\]]*)\](.+?)\[\/user\]/isu",
$arFields[
"POST_TEXT"], $arMention);
895 if (!empty($arMention))
897 $arMentionedUserID = array_merge($arMentionedUserID, $arMention[1]);
901 return $arMentionedUserID;
923 $arParams[
"DATE_TIME_FORMAT"] = (isset(
$arParams[
"DATE_TIME_FORMAT"]) ?
$arParams[
"DATE_TIME_FORMAT"] :
$DB->DateFormatToPHP(CSite::GetDateFormat(
"FULL")));
930 if (
$arParams[
"AVATAR_SIZE_COMMENT"] === 0)
942 strcasecmp(LANGUAGE_ID,
'EN') !== 0
943 && strcasecmp(LANGUAGE_ID,
'DE') !== 0
955 "AVATAR_SIZE_COMMENT" =>
$arParams[
"AVATAR_SIZE_COMMENT"]
959 if (intval($arAuthor[
"PERSONAL_PHOTO"]) > 0)
961 $image_resize = CFile::ResizeImageGet(
962 $arAuthor[
"PERSONAL_PHOTO"],
964 "width" =>
$arParams[
"AVATAR_SIZE_COMMENT"],
965 "height" =>
$arParams[
"AVATAR_SIZE_COMMENT"]
969 $arAuthor[
"PERSONAL_PHOTO_RESIZED"] =
array(
"src" => $image_resize[
"src"]);
972 $arAllow =
array(
"HTML" =>
"N",
"ANCHOR" =>
"Y",
"BIU" =>
"Y",
"IMG" =>
"Y",
"QUOTE" =>
"Y",
"CODE" =>
"Y",
"FONT" =>
"Y",
"LIST" =>
"Y",
"SMILES" =>
"Y",
"NL2BR" =>
"N",
"VIDEO" =>
"Y",
"SHORT_ANCHOR" =>
"Y");
973 $arParserParams = Array(
975 "imageHeight" => 800,
976 "pathToUser" =>
$arParams[
"PATH_TO_USER"]
980 $arParserParams[
"pathToUserEntityType"] =
'LOG_ENTRY';
981 $arParserParams[
"pathToUserEntityId"] = intval(
$arParams[
"LOG_ID"]);
984 if ($commentAuxProvider = \
Bitrix\Socialnetwork\CommentAux\Base::findProvider(
$comment))
986 $comment[
"AuxType"] = mb_strtolower($commentAuxProvider->getType());
987 $comment[
"TextFormated"] = $commentAuxProvider->getText();
989 $commentAuxProvider->setOptions(
array(
992 $comment[
"TextFormatedMobile"] = $commentAuxProvider->getText();
997 $ufCode =
"UF_BLOG_COMMENT_FILE";
998 if (is_array(
$comment[
"UF"][$ufCode]))
1000 $p->arUserfields =
array($ufCode => array_merge(
$comment[
"UF"][$ufCode],
array(
"TAG" =>
"DOCUMENT ID")));
1005 $comment[
"TextFormatedMobile"] =
$p->convert(
$comment[
"POST_TEXT"],
false,
array(), $arAllow, $arParserParams);
1009 $comment[
"TextFormatedJS"] = CUtil::JSEscape(htmlspecialcharsBack(
$comment[
"POST_TEXT"]));
1010 $comment[
"TITLE"] = CUtil::JSEscape(htmlspecialcharsBack(
$comment[
"TITLE"]));
1012 $authorType =
false;
1014 isset($arAuthor[
"EXTERNAL_AUTH_ID"])
1015 && $arAuthor[
"EXTERNAL_AUTH_ID"] ==
'email'
1018 $authorType =
'EMAIL';
1023 empty($arAuthor[
"UF_DEPARTMENT"])
1025 is_array($arAuthor[
"UF_DEPARTMENT"])
1026 && empty($arAuthor[
"UF_DEPARTMENT"][0])
1031 $authorType =
'EXTRANET';
1034 $eventHandlerID =
AddEventHandler(
"main",
"system.field.view.file", Array(
"CSocNetLogTools",
"logUFfileShow"));
1036 "bitrix:main.post.list",
1039 "TEMPLATE_ID" =>
'BLOG_COMMENT_BG_',
1040 "RATING_TYPE_ID" => (
$arParams[
"SHOW_RATING"] ==
"Y" ?
"BLOG_COMMENT" :
""),
1041 "ENTITY_XML_ID" =>
"BLOG_".$arPost[
"ID"],
1043 $commentId =>
array(
1045 "RATING_VOTE_ID" =>
'BLOG_COMMENT_'.
$comment[
"ID"].
'-'.(time()+rand(0, 1000)),
1046 "NEW" => ((
$arParams[
"FOLLOW"] ??
null) !=
"N" && (
$comment[
"NEW"] ??
null) ==
"Y" ?
"Y" :
"N"),
1048 "AUX_LIVE_PARAMS" => (!empty(
$arParams[
"AUX_LIVE_PARAMS"]) ?
$arParams[
"AUX_LIVE_PARAMS"] :
''),
1050 "POST_TIMESTAMP" => $timestamp,
1051 "POST_TIME" =>
$comment[
"DATE_CREATE_TIME"] ??
null,
1052 "POST_DATE" =>
$comment[
"DateFormated"],
1054 "ID" => $arAuthor[
"ID"],
1055 "NAME" => $arAuthor[
"~NAME"],
1056 "LAST_NAME" => $arAuthor[
"~LAST_NAME"],
1057 "SECOND_NAME" => $arAuthor[
"~SECOND_NAME"],
1058 "LOGIN" => $arAuthor[
"~LOGIN"],
1059 "PERSONAL_GENDER" => $arAuthor[
"~PERSONAL_GENDER"],
1060 "AVATAR" => $arAuthor[
"PERSONAL_PHOTO_resized"][
"src"] ??
null,
1061 "EXTERNAL_AUTH_ID" => (isset($arAuthor[
"EXTERNAL_AUTH_ID"]) ? $arAuthor[
"EXTERNAL_AUTH_ID"] :
''),
1062 "TYPE" => $authorType
1066 "~POST_MESSAGE_TEXT" =>
$comment[
"POST_TEXT"],
1068 "POST_TIME" =>
$comment[
"DATE_CREATE_TIME"] ??
null,
1069 "POST_DATE" =>
$comment[
"DateFormated"],
1071 "POST_MESSAGE_TEXT" =>
$comment[
"TextFormated"],
1073<script>
top.text{$commentId} = text{$commentId} =
'{$comment["TextFormatedJS"]}';
top.title{$commentId} =
title{$commentId} =
'{$comment["TITLE"]}';
top.arComFiles{$commentId} = [];</script>
1077 "POST_TIME" =>
$comment[
"DATE_CREATE_TIME"] ??
null,
1078 "POST_DATE" =>
$comment[
"DateFormated"],
1080 "POST_MESSAGE_TEXT" =>
$comment[
"TextFormatedMobile"]
1092 "VISIBLE_RECORDS_COUNT" => 1,
1094 "ERROR_MESSAGE" =>
"",
1096 "RESULT" => $commentId,
1097 "PUSH&PULL" =>
array(
1098 "ACTION" =>
"REPLY",
1100 "AUTHOR_ID" => $arAuthor[
"ID"]
1109 "MODERATE_URL" =>
"",
1113 "AVATAR_SIZE" =>
$arParams[
"AVATAR_SIZE_COMMENT"],
1114 "NAME_TEMPLATE" =>
$arParams[
"NAME_TEMPLATE"],
1115 "SHOW_LOGIN" =>
$arParams[
"SHOW_LOGIN"],
1117 "DATE_TIME_FORMAT" =>
"",
1121 "NOTIFY_TEXT" =>
"",
1122 "SHOW_MINIMIZED" =>
"Y",
1123 "SHOW_POST_FORM" => (!empty(
$arParams[
"CAN_USER_COMMENT"]) &&
$arParams[
"CAN_USER_COMMENT"] ?
"Y" :
"N"),
1127 'CURRENT_USER_ID' => (isset(
$arParams[
'CURRENT_USER_ID']) ? (
int)
$arParams[
'CURRENT_USER_ID'] : 0),
1133 $eventHandlerID !==
false
1134 && intval($eventHandlerID) > 0
1149 "AFTER_MOBILE" =>
""
1159 $eventHandlerID =
AddEventHandler(
"main",
"system.field.view.file", Array(
"CSocNetLogTools",
"logUFfileShow"));
1161 foreach ($arUF as $FIELD_NAME => $arUserField)
1163 if(!empty($arUserField[
"VALUE"]))
1166 "bitrix:system.field.view",
1167 $arUserField[
"USER_TYPE"][
"USER_TYPE_ID"],
1169 "arUserField" => $arUserField,
1173 array(
"HIDE_ICONS"=>
"Y")
1178 $eventHandlerID !==
false
1179 && intval($eventHandlerID) > 0
1185 $arResult[
"AFTER_MOBILE"] = ob_get_clean();
1189 $eventHandlerID =
AddEventHandler(
"main",
"system.field.view.file", Array(
"CSocNetLogTools",
"logUFfileShow"));
1191 foreach ($arUF as $FIELD_NAME => $arUserField)
1193 if(!empty($arUserField[
"VALUE"]))
1196 "bitrix:system.field.view",
1197 $arUserField[
"USER_TYPE"][
"USER_TYPE_ID"],
1199 "arUserField" => $arUserField
1202 array(
"HIDE_ICONS"=>
"Y")
1207 $eventHandlerID !==
false
1208 && intval($eventHandlerID) > 0
const BLOG_PERMS_MODERATE
const BLOG_PUBLISH_STATUS_PUBLISH
const BLOG_PERMS_PREMODERATE
if(!is_object($USER)||! $USER->IsAuthorized()) $userId
static encode($string, $flags=ENT_COMPAT, $doubleEncode=true)
static PreparePath($blogUrl, $siteID=False, $is404=True, $userID=0, $groupID=0)
static GetBlogUserCommentPerms($id, $userId)
static GetPostID($postID, $code, $allowCode=false)
static PreparePath($blogUrl, $postID=0, $siteID=False, $is404=True, $userID=0, $groupID=0)
static GetSocNetPostPerms( $postId=0, $bNeedFull=false, $userId=false, $postAuthor=0)
static GetUserName($alias, $name, $lastName, $login, $secondName="")
static GetUserInfo($id, $path, $arParams=array())
static PreparePath($userID=0, $siteID=False, $is404=True)
static GetByID($ID, $selectType=BLOG_BY_BLOG_USER_ID)
static Index($MODULE_ID, $ITEM_ID, $arFields, $bOverWrite=false, $SEARCH_SESS_ID='')
static GetList($arOrder=Array("ID"=> "DESC"), $arFilter=Array(), $arGroupBy=false, $arNavStartParams=false, $arSelectFields=array())
static Update($ID, $arFields, $bSearchIndex=true)
static GetAuthorityRating()
static GetRatingResult($ID, $entityId)
static killAllTags($text)
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
bx_acc_lim_group_list limitGroupList[] multiple<?=$group[ 'ID']?> ID selected margin top
global $USER_FIELD_MANAGER
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
const BX_RESIZE_IMAGE_EXACT
ExecuteModuleEventEx($arEvent, $arParams=[])
htmlspecialcharsback($str)
IsModuleInstalled($module_id)
ParseDateTime($datetime, $format=false)
AddEventHandler($FROM_MODULE_ID, $MESSAGE_ID, $CALLBACK, $SORT=100, $FULL_PATH=false)
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
GetMessage($name, $aReplace=null)
check_email($email, $strict=false, $domainCheck=false)
FormatDateFromDB($date, $format='FULL', $phpFormat=false)
MakeTimeStamp($datetime, $format=false)
RemoveEventHandler($FROM_MODULE_ID, $MESSAGE_ID, $iEventHandlerKey)
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
<? endif;?> window document title
</p ></td >< td valign=top style='border-top:none;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt;padding:0cm 2.0pt 0cm 2.0pt;height:9.0pt'>< p class=Normal align=center style='margin:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'>< a name=ТекстовоеПоле54 ></a ><?=($taxRate > count( $arTaxList) > 0) ? $taxRate."%"
const SONET_ROLES_AUTHORIZED
$GLOBALS['_____370096793']