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


PHP CBlogPost::CounterInc方法代码示例

本文整理汇总了PHP中CBlogPost::CounterInc方法的典型用法代码示例。如果您正苦于以下问题:PHP CBlogPost::CounterInc方法的具体用法?PHP CBlogPost::CounterInc怎么用?PHP CBlogPost::CounterInc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CBlogPost的用法示例。


在下文中一共展示了CBlogPost::CounterInc方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: array

if (!empty($arBlog) && $arBlog["ACTIVE"] == "Y" || $arResult["bFromList"]) {
    if (!empty($arPost)) {
        if (($arParams["GET_FOLLOW"] == "Y" && (!array_key_exists("FOLLOW", $arParams) || strlen($arParams["FOLLOW"]) <= 0) || intval($arParams["LOG_ID"]) <= 0) && CModule::IncludeModule("socialnetwork")) {
            $rsLogSrc = CSocNetLog::GetList(array(), array("EVENT_ID" => array("blog_post", "blog_post_micro", "blog_post_important"), "SOURCE_ID" => $arParams["ID"], "SITE_ID" => CModule::IncludeModule('extranet') && CExtranet::IsExtranetSite() ? SITE_ID : array(SITE_ID, false)), false, false, $arParams["GET_FOLLOW"] == "Y" ? array("ID", "FOLLOW", "FAVORITES_USER_ID") : array("ID", "FAVORITES_USER_ID"), $arParams["GET_FOLLOW"] == "Y" ? array("USE_FOLLOW" => "Y") : array());
            if ($arLogSrc = $rsLogSrc->Fetch()) {
                $arParams["LOG_ID"] = $arLogSrc["ID"];
                $arParams["FAVORITES_USER_ID"] = $arLogSrc["FAVORITES_USER_ID"];
                if ($arParams["GET_FOLLOW"] == "Y") {
                    $arParams["FOLLOW"] = $arLogSrc["FOLLOW"];
                }
            } elseif (!$arResult["bFromList"]) {
                $bNoLogEntry = true;
            }
        }
        if (!$arResult["bFromList"]) {
            CBlogPost::CounterInc($arPost["ID"]);
        }
        $arPost = CBlogTools::htmlspecialcharsExArray($arPost);
        if ($arPost["AUTHOR_ID"] == $user_id) {
            $arPost["perms"] = $arResult["PostPerm"] = BLOG_PERMS_FULL;
        } elseif ($arResult["bFromList"]) {
            $arPost["perms"] = $arResult["PostPerm"] = BLOG_PERMS_READ;
            if (CSocNetUser::IsCurrentUserModuleAdmin(SITE_ID, !isset($arParams["MOBILE"]) || $arParams["MOBILE"] != "Y") || $APPLICATION->GetGroupRight("blog") >= "W") {
                $arPost["perms"] = $arResult["PostPerm"] = BLOG_PERMS_FULL;
            }
        } else {
            $arPost["perms"] = $arResult["PostPerm"] = $bNoLogEntry ? BLOG_PERMS_DENY : CBlogPost::GetSocNetPostPerms($arPost["ID"], true, false, $arPost["AUTHOR_ID"]);
        }
        $arResult["Post"] = $arPost;
        $arResult["PostSrc"] = $arPost;
        $arResult["Blog"] = $arBlog;
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php

示例2: unset

$arResult["Blog"] = $arBlog;
$arGroup = CBlogGroup::GetByID($arBlog["GROUP_ID"]);
if (!empty($arBlog) && $arBlog["ACTIVE"] == "Y" && $arGroup["SITE_ID"] == SITE_ID) {
    if ($bIDbyCode) {
        $arParams["ID"] = CBlogPost::GetID($arParams["ID"], $arBlog["ID"]);
    }
    $arPost = CBlogPost::GetByID($arParams["ID"]);
    if (empty($arPost) && !$bIDbyCode) {
        $arParams["ID"] = CBlogPost::GetID($arParams["ID"], $arBlog["ID"]);
        $arPost = CBlogPost::GetByID($arParams["ID"]);
    }
    if (!empty($arPost) && $arPost["PUBLISH_STATUS"] != BLOG_PUBLISH_STATUS_PUBLISH) {
        unset($arPost);
    }
    if (!empty($arPost) && $arBlog["ID"] == $arPost["BLOG_ID"]) {
        CBlogPost::CounterInc($arParams["ID"]);
        $arPost = CBlogTools::htmlspecialcharsExArray($arPost);
        $arResult["Post"] = $arPost;
        $arResult["PostPerm"] = CBlogPost::GetBlogUserPostPerms($arParams["ID"], $arResult["USER_ID"]);
        if ($arPost["AUTHOR_ID"] == $arBlog["OWNER_ID"]) {
            $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arBlog["URL"], "user_id" => $arPost["AUTHOR_ID"]));
        } else {
            $arOwnerBlog = CBlog::GetByOwnerID($arPost["AUTHOR_ID"], $arParams["GROUP_ID"]);
            $arResult["urlToBlog"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG"], array("blog" => $arOwnerBlog["URL"], "user_id" => $arPost["AUTHOR_ID"]));
        }
        $arResult["urlToPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST"], array("blog" => $arBlog["URL"], "post_id" => CBlogPost::GetPostID($arResult["Post"]["ID"], $arResult["Post"]["CODE"], $arParams["ALLOW_POST_CODE"]), "user_id" => $arPost["AUTHOR_ID"]));
        if ($_GET["become_friend"] == "Y" && $arResult["PostPerm"] < BLOG_PERMS_READ) {
            if ($USER->IsAuthorized()) {
                $dbCandidate = CBlogCandidate::GetList(array(), array("BLOG_ID" => $arBlog["ID"], "USER_ID" => $arResult["USER_ID"]));
                if ($arCandidate = $dbCandidate->Fetch()) {
                    $arResult["MESSAGE"] = GetMessage("B_B_MES_REQUEST_ALREADY") . "<br />";
开发者ID:Satariall,项目名称:izurit,代码行数:31,代码来源:component.php


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