<?php
// CBlogPost :: __AddSocNetPerms()
// /dist/bitrix/modules/blog/general/blog_post.php:1237
public static function __AddSocNetPerms($ID, $entityType = "", $entityID = 0, $entity)
{
global $DB;
static $allowedTypes = false;
if ($allowedTypes === false)
{
$allowedTypes = Array("D", "U", "UP", "SG", "DR", "G", "AU");
if (IsModuleInstalled('crm'))
{
$allowedTypes[] = "CRMCONTACT";
}
}
if(IntVal($ID) > 0 && strlen($entityType) > 0 && strlen($entity) > 0 && in_array($entityType, $allowedTypes))
{
$arSCFields = Array("POST_ID" => $ID, "ENTITY_TYPE" => $entityType, "ENTITY_ID" => IntVal($entityID), "ENTITY" => $entity);
$arSCInsert = $DB->PrepareInsert("b_blog_socnet_rights", $arSCFields);
if (strlen($arSCInsert[0]) > 0)
{
$strSql =
"INSERT INTO b_blog_socnet_rights(".$arSCInsert[0].") ".
"VALUES(".$arSCInsert[1].")";
$DB->Query($strSql, False, "File: ".__FILE__."<br>Line: ".__LINE__);
return true;
}
}
return false;
}