CBlogUser :: SetLastVisit: Bitrix method

      
<?php 
//  CBlogUser :: SetLastVisit()
//  /dist/bitrix/modules/blog/general/blog_user.php:313

    
public static function SetLastVisit()
    {
        if (isset(
$GLOBALS["BLOG_USER"]["BLOG_LAST_VISIT_SET"]) && $GLOBALS["BLOG_USER"]["BLOG_LAST_VISIT_SET"] == "Y")
            return 
True;

        if (!
$GLOBALS["USER"]->IsAuthorized())
            return 
False;

        
$userID IntVal($GLOBALS["USER"]->GetID());
        if (
$userID <= 0)
            return 
False;

        
$arBlogUser CBlogUser::GetByID($userIDBLOG_BY_USER_ID);
        if (
$arBlogUser)
            
CBlogUser::Update(
                
$arBlogUser["ID"],
                array(
"=LAST_VISIT" => $GLOBALS["DB"]->GetNowFunction())
            );
        else
            
CBlogUser::Add(
                array(
                    
"USER_ID" => $userID,
                    
"=LAST_VISIT" => $GLOBALS["DB"]->GetNowFunction(),
                    
"=DATE_REG" => $GLOBALS["DB"]->GetNowFunction(),
                    
"ALLOW_POST" => "Y"
                
)
            );

        
$GLOBALS["BLOG_USER"]["BLOG_LAST_VISIT_SET"] = "Y";

        return 
True;
    }