本文整理汇总了PHP中CSocNetUserRelations::DeleteRelation方法的典型用法代码示例。如果您正苦于以下问题:PHP CSocNetUserRelations::DeleteRelation方法的具体用法?PHP CSocNetUserRelations::DeleteRelation怎么用?PHP CSocNetUserRelations::DeleteRelation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CSocNetUserRelations
的用法示例。
在下文中一共展示了CSocNetUserRelations::DeleteRelation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetMessage
$APPLICATION->SetTitle($strTitleFormatted . ": " . GetMessage("SONET_C35_PAGE_TITLE"));
}
if ($arParams["SET_NAV_CHAIN"] != "N") {
$APPLICATION->AddChainItem($strTitleFormatted, $arResult["Urls"]["User"]);
$APPLICATION->AddChainItem(GetMessage("SONET_C35_PAGE_TITLE"));
}
if ($arResult["CurrentUserPerms"]["IsCurrentUser"]) {
$arResult["FatalError"] = GetMessage("SONET_C35_SELF") . ". ";
} elseif ($arResult["CurrentUserRelation"] != SONET_RELATIONS_FRIEND) {
$arResult["FatalError"] = GetMessage("SONET_C35_NOT_FRIEND") . ". ";
} else {
$arResult["ShowForm"] = "Input";
if ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["save"]) > 0 && check_bitrix_sessid()) {
$errorMessage = "";
if (strlen($errorMessage) <= 0) {
if (!CSocNetUserRelations::DeleteRelation($GLOBALS["USER"]->GetID(), $arResult["User"]["ID"])) {
if ($e = $APPLICATION->GetException()) {
$errorMessage .= $e->GetString();
}
}
}
if (strlen($errorMessage) > 0) {
$arResult["ErrorMessage"] = $errorMessage;
} else {
$arResult["ShowForm"] = "Confirm";
}
}
}
}
}
}
示例2: array
if ($_SERVER["REQUEST_METHOD"] == "POST" && strlen($_POST["delete"]) > 0 && $arResult["CurrentUserPerms"]["IsCurrentUser"] && 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_C33_NOT_SELECTED") . ". ";
}
}
if (strlen($errorMessage) <= 0) {
foreach ($arIDs as $user_id) {
if (!CSocNetUserRelations::DeleteRelation($arResult["User"]["ID"], $user_id)) {
if ($e = $APPLICATION->GetException()) {
$errorMessage .= $e->GetString();
}
}
}
}
if (strlen($errorMessage) > 0) {
$arResult["ErrorMessage"] = $errorMessage;
}
}
if ($arResult["CurrentUserPerms"] && $arResult["CurrentUserPerms"]["Operations"]["viewprofile"] && $arResult["CurrentUserPerms"]["Operations"]["viewfriends"]) {
$arNavParams = array("nPageSize" => $arParams["ITEMS_COUNT"], "bDescPageNumbering" => false);
$arNavigation = CDBResult::GetNavParams($arNavParams);
$arResult["Urls"]["Search"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_SEARCH"], array());
$arResult["Urls"]["LogUsers"] = CComponentEngine::MakePathFromTemplate($arParams["PATH_TO_LOG"], array());