当前位置: 首页>>代码示例>>PHP>>正文


PHP CBlogPost::GetById方法代码示例

本文整理汇总了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;
 }
开发者ID:k-kalashnikov,项目名称:geekcon_new,代码行数:33,代码来源:idea_sonet_notify.php

示例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"];
开发者ID:webgksupport,项目名称:alpina,代码行数:31,代码来源:component.php


注:本文中的CBlogPost::GetById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。