本文整理汇总了PHP中CBlogPost::UpdateLog方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogPost::UpdateLog方法的具体用法?PHP CBlogPost::UpdateLog怎么用?PHP CBlogPost::UpdateLog使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogPost
的用法示例。
在下文中一共展示了CBlogPost::UpdateLog方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$bNeedAddGrat = false;
} elseif (is_array($arResult["PostToShow"]["GRAT_CURRENT"]) && intval($arResult["PostToShow"]["GRAT_CURRENT"]["ID"]) > 0 && CModule::IncludeModule("iblock")) {
CIBlockElement::Delete($arResult["PostToShow"]["GRAT_CURRENT"]["ID"]);
}
}
$arOldPost = CBlogPost::GetByID($arParams["ID"]);
preg_match_all("/\\[user\\s*=\\s*([^\\]]*)\\](.+?)\\[\\/user\\]/ies" . BX_UTF_PCRE_MODIFIER, $arOldPost["DETAIL_TEXT"], $arMentionOld);
$socnetRightsOld = CBlogPost::GetSocnetPerms($arParams["ID"]);
if ($newID = CBlogPost::Update($arParams["ID"], $arFields)) {
BXClearCache(true, "/blog/socnet_post/" . $arParams["ID"] . "/");
$arFields["AUTHOR_ID"] = $arOldPost["AUTHOR_ID"];
if ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_DRAFT && $arOldPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
CBlogPost::DeleteLog($newID);
} elseif ($arFields["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH && $arOldPost["PUBLISH_STATUS"] == BLOG_PUBLISH_STATUS_PUBLISH) {
$arParamsUpdateLog = array("allowVideo" => $arResult["allowVideo"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"]);
CBlogPost::UpdateLog($newID, $arFields, $arBlog, $arParamsUpdateLog);
}
}
} else {
$arFields["=DATE_CREATE"] = $DB->GetNowFunction();
$arFields["AUTHOR_ID"] = $arResult["UserID"];
$arFields["BLOG_ID"] = $arBlog["ID"];
$newID = CBlogPost::Add($arFields);
$socnetRightsOld = array("U" => array());
$bAdd = true;
$bNeedMail = false;
}
if (IntVal($newID) > 0) {
if ($bNeedAddGrat && CModule::IncludeModule("iblock")) {
$arGratFromPOST = false;
$arUsersFromPOST = false;
示例2: GetMessage
$arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_SESSID_WRONG");
}
}
} elseif (IntVal($_GET["pub_id"]) > 0) {
if ($_GET["success"] == "Y") {
$arResult["OK_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_PUB");
} else {
if (check_bitrix_sessid()) {
$pub_id = IntVal($_GET["pub_id"]);
$arPost = CBlogPost::GetByID($pub_id);
if (!empty($arPost) && ($arPost["AUTHOR_ID"] == $arParams["USER_ID"] || $bGroupMode) && $arPost["PUBLISH_STATUS"] != BLOG_PUBLISH_STATUS_PUBLISH) {
if (CBlogPost::Update($pub_id, array("PUBLISH_STATUS" => BLOG_PUBLISH_STATUS_PUBLISH, "=DATE_PUBLISH" => $DB->GetNowFunction()))) {
$arParamsNotify = array("bSoNet" => true, "allowVideo" => $arResult["allowVideo"], "PATH_TO_SMILE" => $arParams["PATH_TO_SMILE"], "PATH_TO_POST" => $arParams["PATH_TO_POST"], "SOCNET_GROUP_ID" => $arParams["SOCNET_GROUP_ID"], "user_id" => $arPost["AUTHOR_ID"], "NAME_TEMPLATE" => $arParams["NAME_TEMPLATE"], "SHOW_LOGIN" => $arParams["SHOW_LOGIN"]);
$dbRes = CSocNetLog::GetList(array("ID" => "DESC"), array("EVENT_ID" => array("blog_post", "blog_post_important"), "SOURCE_ID" => $pub_id), false, false, array("ID", "ENTITY_TYPE", "ENTITY_ID"));
if ($arRes = $dbRes->Fetch()) {
CBlogPost::UpdateLog($pub_id, $arPost, false, $arParamsNotify);
} else {
CBlogPost::Notify($arPost, false, $arParamsNotify);
$socnetRights = CBlogPost::GetSocNetPermsCode($arPost["ID"]);
$arFieldsIM = array("TYPE" => "POST", "TITLE" => $arPost["TITLE"], "URL" => CComponentEngine::MakePathFromTemplate(htmlspecialcharsBack($arParams["PATH_TO_POST"]), array("post_id" => $arPost["ID"], "user_id" => $arPost["AUTHOR_ID"])), "ID" => $arPost["ID"], "FROM_USER_ID" => $arPost["AUTHOR_ID"], "TO_USER_ID" => array(), "TO_SOCNET_RIGHTS" => $socnetRights, "TO_SOCNET_RIGHTS_OLD" => array("U" => array(), "SG" => array()));
CBlogPost::NotifyIm($arFieldsIM);
}
LocalRedirect($APPLICATION->GetCurPageParam("pub_id=" . $pub_id . "&success=Y", array("del_id", "pub_id", "sessid", "success")));
} else {
$arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_PUB_ERROR");
}
} else {
$arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_BLOG_MES_PUB_NO_RIGHTS");
}
} else {
$arResult["ERROR_MESSAGE"][] = GetMessage("BLOG_BLOG_SESSID_WRONG");