CAdvBanner :: FixShow: Bitrix method

      
<?php 
//  CAdvBanner :: FixShow()
//  /dist/bitrix/modules/advertising/classes/general/advertising.php:4375

    
public static function FixShow($arBanner)
    {
        global 
$DB$CACHE_ADVERTISING;

        if (
intval($_SESSION["SESS_SEARCHER_ID"])<=&& $arBanner["FIX_SHOW"] == "Y" && COption::GetOptionString('advertising''DONT_FIX_BANNER_SHOWS') <> "Y")
        {
            
$BANNER_ID intval($arBanner["ID"]);
            
$CONTRACT_ID intval($arBanner["CONTRACT_ID"]);

            if (
$BANNER_ID>0)
            {
                
CAdvBanner::SetCookie($arBanner$inc_banner_counter$inc_contract_counter);

                if (
strlen($arBanner["DATE_SHOW_FIRST"])<=0)
                {
                    
$CACHE_ADVERTISING["ALL_DATE_SHOW_FIRST"][$BANNER_ID] = $DB->CurrentTimeFunction();
                }

                if (
is_array($_SESSION["SESS_VIEWED_BANNERS"]) &&
                    
in_array($BANNER_ID$_SESSION["SESS_VIEWED_BANNERS"]))
                {
                    
$inc_banner_counter="N";
                }

                if (
is_array($_SESSION["SESS_VIEWED_CONTRACTS"]) &&
                    
in_array($CONTRACT_ID$_SESSION["SESS_VIEWED_CONTRACTS"]))
                {
                    
$inc_contract_counter="N";
                }

                
$CACHE_ADVERTISING["BANNERS_ALL"][] = $BANNER_ID;

                if (
$inc_banner_counter=="Y")
                {
                    
$CACHE_ADVERTISING["BANNERS_CNT"][] = $BANNER_ID;
                    
$_SESSION["SESS_VIEWED_BANNERS"][] = $BANNER_ID;
                }

                if (
$CONTRACT_ID>0)
                {
                    
$CACHE_ADVERTISING["CONTRACTS_ALL"][] = $CONTRACT_ID;

                    if (
$inc_contract_counter=="Y")
                    {
                        
$CACHE_ADVERTISING["CONTRACTS_CNT"][] = $CONTRACT_ID;
                        
$_SESSION["SESS_VIEWED_CONTRACTS"][] = $CONTRACT_ID;
                    }
                }
            }
        }
    }