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