本文整理汇总了PHP中CBlogComment::addLiveComment方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogComment::addLiveComment方法的具体用法?PHP CBlogComment::addLiveComment怎么用?PHP CBlogComment::addLiveComment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogComment
的用法示例。
在下文中一共展示了CBlogComment::addLiveComment方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addComment
public function addComment($authorId, array $data)
{
$this->loadBlogPostData();
$commentFields = array("POST_ID" => $this->entityId, "BLOG_ID" => $this->blogPostData['BLOG_ID'], "POST_TEXT" => $data['text'], "DATE_CREATE" => new DateTime(), "PARENT_ID" => false, "AUTHOR_ID" => $authorId, "HAS_PROPS" => 'Y');
if (!empty($data['fileId'])) {
$commentFields['UF_BLOG_COMMENT_FILE'] = array($data['fileId']);
} elseif (!empty($data['versionId'])) {
$commentFields['UF_BLOG_COMMENT_FH'] = $data['versionId'];
}
$comId = \CBlogComment::add($commentFields);
if (!$comId) {
return;
}
if (method_exists("CBlogComment", "addLiveComment")) {
/** @noinspection PhpDynamicAsStaticMethodCallInspection */
\CBlogComment::addLiveComment($comId, array("MODE" => "PULL_MESSAGE"));
}
BXClearCache(true, "/blog/comment/" . $this->entityId . "/");
if (!Loader::includeModule('socialnetwork')) {
return;
}
$query = \CSocNetLog::getList(array("ID" => "DESC"), array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => $this->entityId), false, false, array("ID", "TMP_ID"));
$row = $query->fetch();
if (!$row) {
return;
}
$fieldsForSocnet = array("ENTITY_TYPE" => SONET_ENTITY_USER, "ENTITY_ID" => $this->blogPostData["AUTHOR_ID"], "EVENT_ID" => "blog_comment", "=LOG_DATE" => Application::getInstance()->getConnection()->getSqlHelper()->getCurrentDateTimeFunction(), "MESSAGE" => "file", "TEXT_MESSAGE" => "file", "URL" => "", "MODULE_ID" => false, "SOURCE_ID" => $comId, "LOG_ID" => $row["ID"], "RATING_TYPE_ID" => "BLOG_COMMENT", "RATING_ENTITY_ID" => $comId, "USER_ID" => $authorId);
\CSocNetLogComments::add($fieldsForSocnet, false, false, false);
}
示例2: htmlspecialcharsback
$arNewRightsName[] = "[user=" . $id . "]" . htmlspecialcharsback($name) . "[/user]";
} else {
$arNewRightsName[] = "[url=" . $link . "]" . htmlspecialcharsback($name) . "[/url]";
}
} else {
$arNewRightsName[] = htmlspecialcharsback($name);
}
}
}
}
$UserIP = CBlogUser::GetUserIP();
$arComFields = array("POST_ID" => $arParams["ID"], "BLOG_ID" => $arPost["BLOG_ID"], "POST_TEXT" => (count($arNewRightsName) > 1 ? GetMessage("B_B_SHARE") : GetMessage("B_B_SHARE_1")) . implode(", ", $arNewRightsName), "DATE_CREATE" => ConvertTimeStamp(time() + $arResult["TZ_OFFSET"], "FULL"), "AUTHOR_IP" => $UserIP[0], "AUTHOR_IP1" => $UserIP[1], "PARENT_ID" => false, "AUTHOR_ID" => $user_id, "SHARE_DEST" => implode(",", $arNewRights));
if ($comId = CBlogComment::Add($arComFields)) {
BXClearCache(true, "/blog/comment/" . intval($arParams["ID"] / 100) . "/" . $arParams["ID"] . "/");
if (is_callable("CBlogComment::AddLiveComment")) {
CBlogComment::addLiveComment($comId, "", array());
}
if ($arPost["AUTHOR_ID"] != $user_id) {
$arFieldsIM = array("TYPE" => "SHARE", "TITLE" => htmlspecialcharsback($arPost["TITLE"]), "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $arParams["ID"], "user_id" => $arPost["AUTHOR_ID"])), "ID" => $arParams["ID"], "FROM_USER_ID" => $user_id, "TO_USER_ID" => array($arPost["AUTHOR_ID"]));
CBlogPost::NotifyIm($arFieldsIM);
}
if (!empty($arUsers2Notify)) {
$arFieldsIM = array("TYPE" => "SHARE2USERS", "TITLE" => htmlspecialcharsback($arPost["TITLE"]), "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $arParams["ID"], "user_id" => $arPost["AUTHOR_ID"])), "ID" => $arParams["ID"], "FROM_USER_ID" => $user_id, "TO_USER_ID" => $arUsers2Notify);
CBlogPost::NotifyIm($arFieldsIM);
}
}
/* update socnet log rights*/
$dbRes = CSocNetLog::GetList(array("ID" => "DESC"), array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => $arPost["ID"]), false, false, array("ID", "ENTITY_TYPE", "ENTITY_ID"));
if ($arRes = $dbRes->Fetch()) {
$arLogSites = array();
$rsLogSite = CSocNetLog::GetSite($arRes["ID"]);