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


PHP CSocNetUserToGroup::SendRequestToBeMember方法代碼示例

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


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

示例1: requestGroupUser

	public static function requestGroupUser($arFields)
	{
		$groupID = $arFields['GROUP_ID'];
		$message = $arFields['MESSAGE'];

		if(intval($groupID) <= 0)
			throw new Exception('Wrong group ID');

		$dbRes = CSocNetGroup::GetList(array(), array(
			"ID" => $groupID,
			"CHECK_PERMISSIONS" => "Y"
		));
		$arGroup = $dbRes->Fetch();
		if(is_array($arGroup))
		{
			$url = (CMain::IsHTTPS() ? "https://" : "http://").$_SERVER["HTTP_HOST"].CComponentEngine::MakePathFromTemplate("/workgroups/group/#group_id#/requests/", array("group_id" => $arGroup["ID"]));

			if (!CSocNetUserToGroup::SendRequestToBeMember($GLOBALS["USER"]->GetID(), $arGroup["ID"], $message, $url, false))
				throw new Exception('Cannot request to join group');

			return true;
		}
		else
			throw new Exception('Socialnetwork group not found');
	}
開發者ID:ASDAFF,項目名稱:bxApiDocs,代碼行數:25,代碼來源:rest.php

示例2: GetMessage

                        }
                        if (strlen($errorMessage) > 0) {
                            $arResult["ErrorMessage"] = $errorMessage;
                        } else {
                            $arResult["ShowForm"] = "Confirm";
                        }
                    } else {
                        $arResult["ShowForm"] = "Input";
                        if ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["save"]) > 0 && check_bitrix_sessid()) {
                            $errorMessage = "";
                            if (strlen($_POST["MESSAGE"]) <= 0) {
                                $errorMessage .= GetMessage("SONET_C39_NO_TEXT") . ". ";
                            }
                            if (strlen($errorMessage) <= 0) {
                                $arResult["Urls"]["GroupRequests"] = (CMain::IsHTTPS() ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . $arResult["Urls"]["GroupRequests"];
                                if (!CSocNetUserToGroup::SendRequestToBeMember($GLOBALS["USER"]->GetID(), $arResult["Group"]["ID"], $_POST["MESSAGE"], $arResult["Urls"]["GroupRequests"], $bAutoSubscribe) && ($e = $APPLICATION->GetException())) {
                                    $errorMessage .= $e->GetString();
                                }
                            }
                            if (strlen($errorMessage) > 0) {
                                $arResult["ErrorMessage"] = $errorMessage;
                            } else {
                                $arResult["ShowForm"] = "Confirm";
                            }
                        }
                    }
                }
            }
        }
    }
}
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:component.php


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