if (isset($_REQUEST['SUBSCTIPTION'][$rub_id]) && $_REQUEST['SUBSCTIPTION'][$rub_id] == "on" && !(in_array($rub_id, $aSubscrRub))) {
$arFields = Array(
"USER_ID" => ($USER->IsAuthorized() ? $USER->GetID() : false),
"FORMAT" => ($_REQUEST['FORMAT'] <> "html" ? "text" : "html"),
"EMAIL" => $_REQUEST['EMAIL'],
"ACTIVE" => "Y",
"RUB_ID" => $rub_id,
);
CSubscription::Add($arFields);
} else if ((!isset($_REQUEST['SUBSCTIPTION'][$rub_id]) || !isset($_REQUEST['SUBSCTIPTION'])) && in_array($rub_id, $aSubscrRub)) {
CSubscription::Delete($rub_id);
} |