Ejemplo n.º 1
0
             if ($arFields && strlen($transport) > 0) {
                 if ($arFields["ENTITY_CB"] != "Y" && array_key_exists($entity_type, $GLOBALS["arSocNetAllowedSubscribeEntityTypesDesc"]) && array_key_exists("HAS_SITE_ID", $GLOBALS["arSocNetAllowedSubscribeEntityTypesDesc"][$entity_type]) && $GLOBALS["arSocNetAllowedSubscribeEntityTypesDesc"][$entity_type]["HAS_SITE_ID"] == "Y" && strlen($site_id) > 0) {
                     $arFieldsVal["SITE_ID"] = $site_id;
                 } else {
                     $arFieldsVal["SITE_ID"] = false;
                 }
                 if (strlen($transport) > 0) {
                     $arFieldsVal["TRANSPORT"] = $transport;
                 }
                 foreach ($arEventID as $event_id) {
                     $arFields["EVENT_ID"] = $event_id;
                     $dbResultTmp = CSocNetLogEvents::GetList(array(), $arFields, false, false, array("ID", "TRANSPORT"));
                     $arFieldsSet = array_merge($arFields, $arFieldsVal);
                     if ($arResultTmp = $dbResultTmp->Fetch()) {
                         if ($arFieldsVal["TRANSPORT"] == "I") {
                             CSocNetLogEvents::Delete($arResultTmp["ID"]);
                         } else {
                             $idTmp = CSocNetLogEvents::Update($arResultTmp["ID"], $arFieldsSet);
                         }
                     } elseif ($arFieldsVal["TRANSPORT"] != "I") {
                         if (!array_key_exists("TRANSPORT", $arFieldsSet)) {
                             $arFieldsSet["TRANSPORT"] = "I";
                         }
                         $idTmp = CSocNetLogEvents::Add($arFieldsSet);
                     }
                 }
             }
         }
     }
 } elseif ($action == "change_follow" && $GLOBALS["USER"]->IsAuthorized()) {
     if ($strRes = CSocNetLogFollow::Set($GLOBALS["USER"]->GetID(), "L" . intval($_REQUEST["log_id"]), $_REQUEST["follow"] == "Y" ? "Y" : "N")) {