本文整理汇总了PHP中CBlogPost::GetMentionedUserID方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogPost::GetMentionedUserID方法的具体用法?PHP CBlogPost::GetMentionedUserID怎么用?PHP CBlogPost::GetMentionedUserID使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogPost
的用法示例。
在下文中一共展示了CBlogPost::GetMentionedUserID方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: OnSearchReindex
//.........这里部分代码省略.........
}
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 (!in_array("U" . $ar["AUTHOR_ID"], $Result["PERMISSIONS"])) {
$Result["PERMISSIONS"][] = "U" . $ar["AUTHOR_ID"];
}
if (is_array($arF["SC_PERM"])) {
$sgId = array();
foreach ($arF["SC_PERM"] 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)) {
$Result["PARAMS"] = array("socnet_group" => $sgId, "entity" => "socnet_group");
}
}
// get mentions and grats
$arMentionedUserID = CBlogPost::GetMentionedUserID($ar);
if (!empty($arMentionedUserID)) {
if (!isset($Result["PARAMS"])) {
$Result["PARAMS"] = array();
}
$Result["PARAMS"]["mentioned_user_id"] = $arMentionedUserID;
}
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" => "Y", "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"]));
}
} else {
$socnetPerms = $arF["SC_PERM"];
if (!in_array("U" . $ar["AUTHOR_ID"], $socnetPerms)) {
$socnetPerms[] = "U" . $ar["AUTHOR_ID"];
}
$socnetPerms[] = "SA";
// socnet admin
$logID = $ar["SLID"];
}
if (intval($logID) > 0 && is_array($socnetPerms)) {
if (in_array("AU", $socnetPerms) || in_array("G2", $socnetPerms)) {
$socnetPermsAdd = array();