本文整理汇总了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;
示例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 />";