本文整理汇总了PHP中CSocNetUserRelations::UnBanMember方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUserRelations::UnBanMember方法的具体用法?PHP CSocNetUserRelations::UnBanMember怎么用?PHP CSocNetUserRelations::UnBanMember使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetUserRelations
的用法示例。
在下文中一共展示了CSocNetUserRelations::UnBanMember方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foreach
if (!in_array($arRelation["FIRST_USER_ID"], $arFriendID) && !in_array($arRelation["SECOND_USER_ID"], $arFriendID)) {
continue;
}
$arRelationID[] = $arRelation["ID"];
$arRelationUserID[] = $arRelation[($user_id == $arRelation["FIRST_USER_ID"] ? "SECOND" : "FIRST") . "_USER_ID"];
}
if (count(array_diff($arFriendID, $arRelationUserID)) > 0) {
echo CUtil::PhpToJsObject(array('ERROR' => 'FRIEND_ID_INCORRECT_2'));
die;
}
if ($_POST['ACTION'] == "BAN") {
foreach ($arRelationUserID as $relation_user_id) {
if (!CSocNetUserRelations::BanUser($user_id, $relation_user_id)) {
echo CUtil::PhpToJsObject(array('ERROR' => 'USER_ACTION_FAILED: ' . (($e = $APPLICATION->GetException()) ? $e->GetString() : "")));
die;
}
}
} else {
foreach ($arRelationID as $relation_id) {
if ($_POST['ACTION'] == "EX" && !CSocNetUserRelations::Delete($relation_id) || $_POST['ACTION'] == "UNBAN" && !CSocNetUserRelations::UnBanMember($user_id, $relation_id)) {
echo CUtil::PhpToJsObject(array('ERROR' => 'USER_ACTION_FAILED: ' . (($e = $APPLICATION->GetException()) ? $e->GetString() : "")));
die;
}
}
}
}
echo CUtil::PhpToJsObject(array('SUCCESS' => 'Y'));
} else {
echo CUtil::PhpToJsObject(array('ERROR' => 'SESSION_ERROR'));
}
require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_after.php";
示例2: elseif
} elseif ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["delete"]) > 0 && check_bitrix_sessid()) {
$errorMessage = "";
$arIDs = array();
if (strlen($errorMessage) <= 0) {
for ($i = 0; $i <= IntVal($_POST["max_count"]); $i++) {
if ($_POST["checked_" . $i] == "Y") {
$arIDs[] = IntVal($_POST["id_" . $i]);
}
}
if (count($arIDs) <= 0) {
$errorMessage .= GetMessage("SONET_C32_NOT_SELECTED") . ". ";
}
}
if (strlen($errorMessage) <= 0) {
foreach ($arIDs as $ban_id) {
if (!CSocNetUserRelations::UnBanMember($GLOBALS["USER"]->GetID(), $ban_id)) {
if ($e = $APPLICATION->GetException()) {
$errorMessage .= $e->GetString();
}
}
}
}
if (strlen($errorMessage) > 0) {
$arResult["ErrorMessage"] = $errorMessage;
}
}
/********************* END ACTIONS *****************************/
if ($arParams["SET_TITLE"] == "Y") {
$APPLICATION->SetTitle(GetMessage("SONET_C32_PAGE_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] != "N") {