當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CBlog::IsFriend方法代碼示例

本文整理匯總了PHP中CBlog::IsFriend方法的典型用法代碼示例。如果您正苦於以下問題:PHP CBlog::IsFriend方法的具體用法?PHP CBlog::IsFriend怎麽用?PHP CBlog::IsFriend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CBlog的用法示例。


在下文中一共展示了CBlog::IsFriend方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: array

             $arF1 = $arF2 = $arMailFields;
             $arF1["EMAIL_TO"] = $arUser["EMAIL"];
             $arF2["EMAIL_TO"] = $arUserBlog["EMAIL"];
             CEvent::Send("BLOG_YOU_TO_BLOG", SITE_ID, $arF1);
             CEvent::Send("BLOG_USER_TO_YOUR_BLOG", SITE_ID, $arF2);
         } else {
             $frnd_er = 1;
         }
     }
 }
 if ($arOwnBlog = CBlog::GetByOwnerID($user_id, $arParams["GROUP_ID"])) {
     $dbCandidate = CBlogCandidate::GetList(array(), array("BLOG_ID" => $arOwnBlog["ID"], "USER_ID" => $arResult["BLOG"]["OWNER_ID"]));
     if ($arCandidate = $dbCandidate->Fetch()) {
         $frnd_ok = 4;
     } else {
         if (CBlog::IsFriend($arOwnBlog["ID"], $arResult["BLOG"]["OWNER_ID"])) {
             $frnd_ok = 5;
         } else {
             if (CBlogCandidate::Add(array("BLOG_ID" => $arOwnBlog["ID"], "USER_ID" => $arResult["BLOG"]["OWNER_ID"]))) {
                 $frnd_ok = 6;
                 $BlogUser = CBlogUser::GetByID($arResult["BLOG"]["OWNER_ID"], BLOG_BY_USER_ID);
                 $BlogUser = CBlogTools::htmlspecialcharsExArray($BlogUser);
                 $dbUser = CUser::GetByID($arResult["BLOG"]["OWNER_ID"]);
                 $arUser = $dbUser->GetNext();
                 $AuthorName = CBlogUser::GetUserName($BlogUser["ALIAS"], $arUser["NAME"], $arUser["LAST_NAME"], $arUser["LOGIN"]);
                 $dbUser = CUser::GetByID($user_id);
                 $arUserBlog = $dbUser->GetNext();
                 if (strlen($serverName) <= 0) {
                     if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
                         $serverName = SITE_SERVER_NAME;
                     } else {
開發者ID:webgksupport,項目名稱:alpina,代碼行數:31,代碼來源:component.php

示例2: elseif

                $arResult["SecondLine"] = "Y";
            } elseif ($perm >= BLOG_PERMS_PREMODERATE) {
                $arResult["urlToNewPost"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_POST_EDIT"], array("blog" => $arBlog["URL"], "post_id" => "new"));
                $arResult["SecondLine"] = "Y";
            }
            if (CBlog::CanUserManageBlog($arBlog["ID"], $user_id)) {
                $arResult["urlToUserSettings"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS"], array("blog" => $arBlog["URL"]));
                $arResult["urlToGroupEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_GROUP_EDIT"], array("blog" => $arBlog["URL"]));
                $arResult["urlToCategoryEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_CATEGORY_EDIT"], array("blog" => $arBlog["URL"]));
                $arResult["urlToBlogEdit"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_BLOG_EDIT"], array("blog" => $arBlog["URL"]));
                $arResult["ThirdLine"] = "Y";
            }
        }
        if (empty($arOwnBlog) || $arOwnBlog["URL"] != $arBlog["URL"]) {
            if (IntVal($user_id) > 0) {
                if (!CBlog::IsFriend($arBlog["ID"], $user_id)) {
                    $arResult["urlToBecomeFriend"] = $arResult["urlToCurrentBlog"] . (strpos($arResult["urlToCurrentBlog"], "?") === false ? "?" : "&") . "become_friend=Y&" . bitrix_sessid_get();
                    $arResult["SecondLine"] = "Y";
                }
                if (!empty($arOwnBlog)) {
                    if (!CBlog::IsFriend($arOwnBlog["ID"], $arBlog["OWNER_ID"])) {
                        $tmpUrl = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_USER_SETTINGS"], array("blog" => $arOwnBlog["URL"]));
                        $arResult["urlToAddFriend"] = $tmpUrl . (strpos($tmpUrl, "?") === false ? "?" : "&") . "add_friend[]=" . UrlEncode($arBlog["URL"]) . "&" . bitrix_sessid_get();
                        $arResult["SecondLine"] = "Y";
                    }
                }
            }
        }
    }
}
$this->IncludeComponentTemplate();
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:component.php


注:本文中的CBlog::IsFriend方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。