CBlogPost :: GetMentionedUserID: Bitrix method

      
<?php 
//  CBlogPost :: GetMentionedUserID()
//  /dist/bitrix/modules/blog/general/blog_post.php:3295

    
public static function GetMentionedUserID($arFields)
    {
        global 
$USER_FIELD_MANAGER;
        
$arMentionedUserID = array();

        if (isset(
$arFields["DETAIL_TEXT"]))
        {
            
preg_match_all("/\[user\s*=\s*([^\]]*)\](.+?)\[\/user\]/is".BX_UTF_PCRE_MODIFIER$arFields["DETAIL_TEXT"], $arMention);
            if (!empty(
$arMention))
            {
                
$arMentionedUserID array_merge($arMentionedUserID$arMention[1]);
            }
        }

        
$arPostUF $USER_FIELD_MANAGER->GetUserFields("BLOG_POST"$arFields["ID"], LANGUAGE_ID);

        if (
            
is_array($arPostUF)
            && isset(
$arPostUF["UF_GRATITUDE"])
            && 
is_array($arPostUF["UF_GRATITUDE"])
            && isset(
$arPostUF["UF_GRATITUDE"]["VALUE"])
            && 
intval($arPostUF["UF_GRATITUDE"]["VALUE"]) > 0
            
&& CModule::IncludeModule("iblock")
        )
        {
            if (
                !
is_array($GLOBALS["CACHE_HONOUR"])
                || !
array_key_exists("honour_iblock_id"$GLOBALS["CACHE_HONOUR"])
                || 
intval($GLOBALS["CACHE_HONOUR"]["honour_iblock_id"]) <= 0
            
)
            {
                
$rsIBlock CIBlock::GetList(array(), array("=CODE" => "honour""=TYPE" => "structure"));
                if (
$arIBlock $rsIBlock->Fetch())
                {
                    
$GLOBALS["CACHE_HONOUR"]["honour_iblock_id"] = $arIBlock["ID"];
                }
            }

            if (
intval($GLOBALS["CACHE_HONOUR"]["honour_iblock_id"]) > 0)
            {
                
$rsElementProperty CIBlockElement::GetProperty(
                    
$GLOBALS["CACHE_HONOUR"]["honour_iblock_id"],
                    
$arPostUF["UF_GRATITUDE"]["VALUE"]
                );
                while (
$arElementProperty $rsElementProperty->GetNext())
                {
                    if (
                        
$arElementProperty["CODE"] == "USERS"
                        
&& intval($arElementProperty["VALUE"]) > 0
                    
)
                    {
                        
$arMentionedUserID[] = $arElementProperty["VALUE"];
                    }
                }
            }
        }

        return 
$arMentionedUserID;
    }