public static function Add($arFields) { global $DB; if (!CSocNetEventUserView::CheckFields("ADD", $arFields)) { return false; } $arInsert = $DB->PrepareInsert("b_sonet_event_user_view", $arFields); if (strlen($arInsert[0]) > 0) { $strSql = "INSERT INTO b_sonet_event_user_view(" . $arInsert[0] . ") " . "VALUES(" . $arInsert[1] . ")"; $DB->Query($strSql, False, "File: " . __FILE__ . "<br>Line: " . __LINE__); } return true; }
} } } } if (StrLen($errorMessage) <= 0) { foreach ($arGroupsId as $ind => $val) { CSocNetUserToGroup::Add(array("USER_ID" => 1, "GROUP_ID" => $val, "ROLE" => "A", "=DATE_CREATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "=DATE_UPDATE" => $GLOBALS["DB"]->CurrentTimeFunction(), "INITIATED_BY_TYPE" => SONET_INITIATED_BY_USER, "INITIATED_BY_USER_ID" => 1, "MESSAGE" => false)); } } if (StrLen($errorMessage) <= 0) { // set EUV vor news $dbResult = CSocNetEventUserView::GetList(array("ENTITY_ID" => "ASC"), array("ENTITY_TYPE" => "N")); $arResult = $dbResult->Fetch(); if (!$arResult) { CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news", "USER_ID" => 0, "USER_ANONYMOUS" => "N")); CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news_comment", "USER_ID" => 0, "USER_ANONYMOUS" => "N")); } $blogGroupID = 0; if (CModule::IncludeModule("blog")) { $dbRes = CBlogGroup::GetList(array("ID" => "DESC"), array("SITE_ID" => WIZARD_SITE_ID)); if ($arRes = $dbRes->Fetch()) { $blogGroupID = $arRes["ID"]; } } $forumID = 0; $photoForumID = 0; if (CModule::IncludeModule("forum")) { $dbRes = CForumNew::GetListEx(array(), array("SITE_ID" => WIZARD_SITE_ID, "XML_ID" => "USERS_AND_GROUPS")); if ($arRes = $dbRes->Fetch()) { $forumID = $arRes["ID"]; }
// set EUV for wiki $dbResult = CSocNetEventUserView::GetList(array("ENTITY_ID" => "DESC"), array("ENTITY_TYPE" => "G"), array("ENTITY_ID")); while ($arResult = $dbResult->Fetch()) { CSocNetEventUserView::SetFeature("G", $arResult["ENTITY_ID"], "wiki"); } // set EUV for news if (IsModuleInstalled("intranet")) { $dbResult = CSocNetEventUserView::GetList(array("ENTITY_ID" => "ASC"), array("ENTITY_TYPE" => "N")); $arResult = $dbResult->Fetch(); if (!$arResult) { CSocNetEventUserView::Add(array("ENTITY_TYPE" => "N", "ENTITY_ID" => 0, "EVENT_ID" => "news", "USER_ID" => 0, "USER_ANONYMOUS" => "N")); } } $dbResult = CSocNetEventUserView::GetList(array("ENTITY_ID" => "DESC"), array("ENTITY_TYPE" => "G"), array("ENTITY_ID")); while ($arResult = $dbResult->Fetch()) { CSocNetEventUserView::SetFeature("G", $arResult["ENTITY_ID"], "wiki"); } // set blog_comment and blog_post for blog $dbResult = CSocNetLogEvents::GetList(array("ENTITY_ID" => "DESC"), array("EVENT_ID" => array("blog_post", "blog_comment", "blog_post_micro")), false, false, array("ID")); while ($arResult = $dbResult->Fetch()) { CSocNetLogEvents::Delete($arResult["ID"]); } $dbResult = CSocNetLogEvents::GetList(array("ENTITY_ID" => "DESC"), array("EVENT_ID" => "blog")); while ($arResult = $dbResult->Fetch()) { $arLogEvent = array("USER_ID" => $arResult["USER_ID"], "ENTITY_TYPE" => $arResult["ENTITY_TYPE"], "ENTITY_ID" => $arResult["ENTITY_ID"], "ENTITY_CB" => $arResult["ENTITY_CB"], "ENTITY_MY" => $arResult["ENTITY_MY"], "MAIL_EVENT" => $arResult["MAIL_EVENT"], "TRANSPORT" => $arResult["TRANSPORT"], "VISIBLE" => $arResult["VISIBLE"]); if (strlen($arResult["SITE_ID"]) > 0) { $arLogEvent["SITE_ID"] = $arResult["SITE_ID"]; } else { $arLogEvent["SITE_ID"] = false; } $arLogEventToAdd = array_merge($arLogEvent, array("EVENT_ID" => "blog_post"));
function IsEntityEmpty($entityType, $entityID) { global $arSocNetAllowedEntityTypes; $entityType = trim($entityType); if (!in_array($entityType, $arSocNetAllowedEntityTypes)) { $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_INCORRECT_ENTITY_TYPE"), "ERROR_INCORRECT_ENTITY_TYPE"); return false; } $entityID = IntVal($entityID); if ($entityID <= 0) { $GLOBALS["APPLICATION"]->ThrowException(GetMessage("SONET_EUV_EMPTY_ENTITY_ID"), "ERROR_EMPTY_ENTITY_ID"); return false; } $iCnt = CSocNetEventUserView::GetList(array(), array("ENTITY_TYPE" => $entityType, "ENTITY_ID" => $entityID), array()); if (intval($iCnt) > 0) { return false; } else { return true; } }