本文整理汇总了PHP中CBlogPost::GetById方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogPost::GetById方法的具体用法?PHP CBlogPost::GetById怎么用?PHP CBlogPost::GetById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CBlogPost
的用法示例。
在下文中一共展示了CBlogPost::GetById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: CallBack_AddComment
public static function CallBack_AddComment($arFields)
{
if (!CModule::IncludeModule('blog')) {
return false;
}
$arResult = array();
$arLog = CSocNetLog::GetList(array("ID" => "DESC"), array("TMP_ID" => $arFields["LOG_ID"]), false, false, array("ID", "SOURCE_ID", "SITE_ID", "RATING_ENTITY_ID"))->Fetch();
if ($arLog) {
$arIdeaPost = CBlogPost::GetById($arLog["SOURCE_ID"]);
if ($arIdeaPost) {
$UserIP = CBlogUser::GetUserIP();
$IdeaCommentId = CBlogComment::Add(array("BLOG_ID" => $arIdeaPost["BLOG_ID"], "POST_ID" => $arIdeaPost["ID"], "AUTHOR_ID" => $arFields["USER_ID"], "POST_TEXT" => $arFields["MESSAGE"], "DATE_CREATE" => ConvertTimeStamp(time() + CTimeZone::GetOffset(), "FULL"), "PARENT_ID" => false, "AUTHOR_IP" => $UserIP[0], "AUTHOR_IP1" => $UserIP[1]));
$arResult = array("SOURCE_ID" => $IdeaCommentId);
if ($arLog["RATING_ENTITY_ID"] > 0) {
$arResult["RATING_TYPE_ID"] = "BLOG_COMMENT";
$arResult["RATING_ENTITY_ID"] = $IdeaCommentId;
}
if (intval($IdeaCommentId) == 0) {
global $APPLICATION;
if ($ex = $APPLICATION->GetException()) {
$arResult["ERROR"] = $ex->GetString();
}
} else {
//clear cache on succcess
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/first_page/");
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/pages/");
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/comment/" . $arIdeaPost["ID"] . "/");
BXClearCache(True, "/" . SITE_ID . "/idea/" . $arIdeaPost["BLOG_ID"] . "/post/" . $arIdeaPost["ID"] . "/");
}
}
}
return $arResult;
}
示例2: array
}
}
}
$arParams["COMMENT_PROPERTY"] = array("UF_BLOG_COMMENT_DOC");
if (CModule::IncludeModule("webdav") || CModule::IncludeModule("disk")) {
$arParams["COMMENT_PROPERTY"][] = "UF_BLOG_COMMENT_FILE";
$arParams["COMMENT_PROPERTY"][] = "UF_BLOG_COMMENT_FH";
}
$arParams["COMMENT_PROPERTY"][] = "UF_BLOG_COMM_URL_PRV";
$arBlog = $arParams["BLOG_DATA"];
$arPost = $arParams["POST_DATA"];
$arResult["Perm"] = BLOG_PERMS_DENY;
$arResult["PostPerm"] = BLOG_PERMS_DENY;
if (IntVal($_REQUEST["comment_post_id"]) > 0) {
$arParams["ID"] = IntVal($_REQUEST["comment_post_id"]);
$arPost = CBlogPost::GetById($arParams["ID"]);
$arPost = CBlogTools::htmlspecialcharsExArray($arPost);
$arBlog = CBlog::GetById($arPost["BLOG_ID"]);
$arBlog = CBlogTools::htmlspecialcharsExArray($arBlog);
if ($arPost["AUTHOR_ID"] == $user_id) {
$arResult["Perm"] = BLOG_PERMS_FULL;
$arResult["PostPerm"] = BLOG_PERMS_FULL;
} else {
$arResult["PostPerm"] = CBlogPost::GetSocNetPostPerms($arParams["ID"]);
if ($arResult["PostPerm"] > BLOG_PERMS_DENY) {
$arResult["Perm"] = CBlogComment::GetSocNetUserPerms($arParams["ID"], $arPost["AUTHOR_ID"]);
}
}
$arResult["is_ajax_post"] = "Y";
} else {
$arResult["PostPerm"] = strlen($arParams["POST_DATA"]["perms"]) <= 0 ? CBlogPost::GetSocNetPostPerms($arParams["ID"]) : $arParams["POST_DATA"]["perms"];