本文整理汇总了PHP中CBlogComment::_IndexPostComments方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogComment::_IndexPostComments方法的具体用法?PHP CBlogComment::_IndexPostComments怎么用?PHP CBlogComment::_IndexPostComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogComment
的用法示例。
在下文中一共展示了CBlogComment::_IndexPostComments方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: OnSearchReindex
//.........这里部分代码省略.........
}
if (IntVal($ar["SLID"]) > 0) {
CSocNetLog::Delete($ar["SLID"]);
$ar["SLID"] = 0;
}
}
$arF = array("SOCNET_RIGHTS" => array());
if (intVal($newBlogId) > 0) {
$arF["BLOG_ID"] = $newBlogId;
}
$arSites = array($ar["SITE_ID"]);
}
if (!empty($arF)) {
if (IntVal($arF["BLOG_ID"]) > 0) {
$Result["PARAM2"] = $ar["BLOG_ID"];
$sqlR = "UPDATE b_blog_post SET BLOG_ID=" . IntVal($arF["BLOG_ID"]) . " WHERE ID=" . IntVal($ar["ID"]);
$DB->Query($sqlR, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$sqlR = "UPDATE b_blog_post_category SET BLOG_ID=" . IntVal($arF["BLOG_ID"]) . " WHERE POST_ID=" . IntVal($ar["ID"]);
$DB->Query($sqlR, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$sqlR = "UPDATE b_blog_image SET BLOG_ID=" . IntVal($arF["BLOG_ID"]) . " WHERE POST_ID=" . IntVal($ar["ID"]);
$DB->Query($sqlR, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
$sqlR = "UPDATE b_blog_comment SET BLOG_ID=" . IntVal($arF["BLOG_ID"]) . " WHERE POST_ID=" . IntVal($ar["ID"]);
$DB->Query($sqlR, False, "File: " . __FILE__ . "<br>Line: " . __LINE__);
}
$sqlR = "SELECT * FROM b_blog_socnet_rights where POST_ID=" . IntVal($ar["ID"]);
$dbBB = $DB->Query($sqlR);
if (!$dbBB->Fetch()) {
$arF["SC_PERM"] = CBlogPost::UpdateSocNetPerms($ar["ID"], $arF["SOCNET_RIGHTS"], array("AUTHOR_ID" => $ar["AUTHOR_ID"]));
}
if (IntVal($arF["BLOG_ID"]) > 0 && $ar["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
$dbComment = CBlogComment::GetList(array(), array("POST_ID" => $ar["ID"]), false, false, array("ID", "POST_ID", "BLOG_ID", "PATH"));
if ($arComment = $dbComment->Fetch()) {
$arParamsComment = array("BLOG_ID" => $arF["BLOG_ID"], "POST_ID" => $ar["ID"], "SITE_ID" => $ar["SITE_ID"], "PATH" => $arPostSite[$arGroup["SITE_ID"]] . "?commentId=#comment_id###comment_id#", "USE_SOCNET" => "Y");
CBlogComment::_IndexPostComments($arParamsComment);
}
}
}
}
if ($ar["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
if (empty($arF["SC_PERM"])) {
$arF["SC_PERM"] = CBlogPost::GetSocNetPermsCode($ar["ID"]);
}
$Result["PERMISSIONS"] = $arF["SC_PERM"];
if (IntVal($ar["SLID"]) <= 0) {
$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");
$text4message = $parserBlog->convert($ar["DETAIL_TEXT"], false, array(), $arAllow, array("isSonetLog" => true));
$arSoFields = array("EVENT_ID" => "blog_post", "=LOG_DATE" => $DB->CharToDateFunction($ar["DATE_PUBLISH"], "FULL", SITE_ID), "LOG_UPDATE" => $DB->CharToDateFunction($ar["DATE_PUBLISH"], "FULL", SITE_ID), "TITLE_TEMPLATE" => "#USER_NAME# add post", "TITLE" => $ar["TITLE"], "MESSAGE" => $text4message, "MODULE_ID" => "blog", "CALLBACK_FUNC" => false, "SOURCE_ID" => $ar["ID"], "ENABLE_COMMENTS" => "N", "ENTITY_TYPE" => SONET_ENTITY_USER, "ENTITY_ID" => $ar["AUTHOR_ID"], "USER_ID" => $ar["AUTHOR_ID"], "URL" => $arSite[$ar["SITE_ID"]], "SITE_ID" => $arSites);
$logID = CSocNetLog::Add($arSoFields, false);
if (intval($logID) > 0) {
$socnetPerms = $arF["SC_PERM"];
if (!in_array("U" . $ar["AUTHOR_ID"], $socnetPerms)) {
$socnetPerms[] = "U" . $ar["AUTHOR_ID"];
}
$socnetPerms[] = "SA";
// socnet admin
CSocNetLog::Update($logID, array("TMP_ID" => $logID, "=LOG_UPDATE" => $arSoFields["LOG_UPDATE"]));
CSocNetLogRights::DeleteByLogID($logID);
CSocNetLogRights::Add($logID, $socnetPerms);
}
} else {
$socnetPerms = $arF["SC_PERM"];
if (!in_array("U" . $ar["AUTHOR_ID"], $socnetPerms)) {
$socnetPerms[] = "U" . $ar["AUTHOR_ID"];
}
$socnetPerms[] = "SA";
// socnet admin
示例2: Update
//.........这里部分代码省略.........
"NAME" => $arUser["NAME"],
"LAST_NAME" => $arUser["LAST_NAME"],
"SECOND_NAME" => $arUser["SECOND_NAME"],
"LOGIN" => $arUser["LOGIN"],
);
$authorName = CUser::FormatName(CSite::GetNameFormat(), $arTmpUser, false, false);
if(strlen($authorName) > 0)
$searchContent .= "\r\n".$authorName;
}
}
$arSearchIndex = array(
"SITE_ID" => $arPostSite,
"LAST_MODIFIED" => $arNewPost["DATE_PUBLISH"],
"PARAM1" => "POST",
"PARAM2" => $arNewPost["BLOG_ID"],
"PARAM3" => $arNewPost["ID"],
"PERMISSIONS" => array(2),
"TITLE" => $arNewPost["TITLE"],
"BODY" => $searchContent,
"TAGS" => $tag,
"USER_ID" => $arNewPost["AUTHOR_ID"],
"ENTITY_TYPE_ID" => "BLOG_POST",
"ENTITY_ID" => $arNewPost["ID"],
);
$bIndexComment = false;
if($arBlog["USE_SOCNET"] == "Y")
{
if(!empty($arFields["SC_PERM"]))
{
$arSearchIndex["PERMISSIONS"] = $arFields["SC_PERM"];
if($arFields["SC_PERM"] != $arFields["SC_PERM_OLD"])
$bIndexComment = true;
}
else
$arSearchIndex["PERMISSIONS"] = CBlogPost::GetSocnetPermsCode($ID);
if(!in_array("U".$arNewPost["AUTHOR_ID"], $arSearchIndex["PERMISSIONS"]))
$arSearchIndex["PERMISSIONS"][] = "U".$arNewPost["AUTHOR_ID"];
if(is_array($arSearchIndex["PERMISSIONS"]))
{
$sgId = array();
foreach($arSearchIndex["PERMISSIONS"] as $perm)
{
if(strpos($perm, "SG") !== false)
{
$sgIdTmp = str_replace("SG", "", substr($perm, 0, strpos($perm, "_")));
if(!in_array($sgIdTmp, $sgId) && IntVal($sgIdTmp) > 0)
$sgId[] = $sgIdTmp;
}
}
if(!empty($sgId))
{
$arSearchIndex["PARAMS"] = array(
"socnet_group" => $sgId,
"entity" => "socnet_group",
);
}
}
// get mentions and grats
$arMentionedUserID = CBlogPost::GetMentionedUserID($arNewPost);
if (!empty($arMentionedUserID))
{
if (!isset($arSearchIndex["PARAMS"]))
{
$arSearchIndex["PARAMS"] = array();
}
$arSearchIndex["PARAMS"]["mentioned_user_id"] = $arMentionedUserID;
}
}
CSearch::Index("blog", "P".$ID, $arSearchIndex, True);
if(($arOldPost["PUBLISH_STATUS"] != BLOG_PUBLISH_STATUS_PUBLISH && $arNewPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) || $bIndexComment) //index comments
{
$arParamsComment = Array(
"BLOG_ID" => $arBlog["ID"],
"POST_ID" => $ID,
"SITE_ID" => $arGroup["SITE_ID"],
"PATH" => $arPostSite[$arGroup["SITE_ID"]]."?commentId=#comment_id###comment_id#",
"BLOG_URL" => $arBlog["URL"],
"OWNER_ID" => $arBlog["OWNER_ID"],
"SOCNET_GROUP_ID" => $arBlog["SOCNET_GROUP_ID"],
"USE_SOCNET" => $arBlog["USE_SOCNET"],
);
CBlogComment::_IndexPostComments($arParamsComment);
}
}
}
}
BXClearCache(true, '/blog/socnet_post/gen/'.$ID);
return $ID;
}