本文整理汇总了PHP中CSocNetUserRelations::BanUser方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUserRelations::BanUser方法的具体用法?PHP CSocNetUserRelations::BanUser怎么用?PHP CSocNetUserRelations::BanUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetUserRelations
的用法示例。
在下文中一共展示了CSocNetUserRelations::BanUser方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unserialize
}
if (!array_key_exists("SHOW_FIELDS_TOOLTIP", $arParams)) {
$arParams["SHOW_FIELDS_TOOLTIP"] = unserialize(COption::GetOptionString("socialnetwork", "tooltip_fields", $arTooltipFieldsDefault));
}
if (!array_key_exists("USER_PROPERTY_TOOLTIP", $arParams)) {
$arParams["USER_PROPERTY_TOOLTIP"] = unserialize(COption::GetOptionString("socialnetwork", "tooltip_properties", $arTooltipPropertiesDefault));
}
if (!$GLOBALS["USER"]->IsAuthorized()) {
$arResult["NEED_AUTH"] = "Y";
} else {
$arNavParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bDescPageNumbering" => false);
$arNavigation = CDBResult::GetNavParams($arNavParams);
/*********************** ACTIONS *******************************/
if ($_REQUEST["action"] == "ban" && check_bitrix_sessid() && IntVal($_REQUEST["userID"]) > 0) {
$errorMessage = "";
if (!CSocNetUserRelations::BanUser($GLOBALS["USER"]->GetID(), IntVal($_REQUEST["userID"]))) {
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_C30_PAGE_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] != "N") {
$APPLICATION->AddChainItem(GetMessage("SONET_C30_PAGE_TITLE"));
}
示例2: array
$arRelationUserID = array();
$rsRelation = CSocNetUserRelations::GetRelatedUsers($user_id, $relation_type);
while ($arRelation = $rsRelation->Fetch()) {
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 {