本文整理匯總了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');
}
示例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";
}
}
}
}
}
}
}
}