HEX
Server: Apache/2.4.6 (CentOS) mpm-itk/2.4.7-04 mod_fcgid/2.3.9 PHP/5.4.16
System: Linux dvm.vladweb.ru 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: region-gk.ru (1016)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: //var/www/temp/yarustone.ru/bitrix/components/bitrix/iblock.tv/stat.php
<?
define('PUBLIC_AJAX_MODE', true);
require_once($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");

if(
	isset($_SESSION["player_files"])
	&& is_array($_SESSION["player_files"])
	&& isset($_REQUEST["id"])
	&& isset($_SESSION["player_files"][$_REQUEST["id"]])
)
{
	$arFile = $_SESSION["player_files"][$_REQUEST["id"]];
	if(
		$arFile["STAT_EVENT"]
		&& !$arFile["WAS_STAT_EVENT"] //not yet for this session
		&& strlen($arFile["STAT_EVENT1"]) > 0 //event1 defined
		&& CModule::IncludeModule('statistic')
	)
	{
		CStatEvent::AddCurrent($arFile["STAT_EVENT1"], $arFile["STAT_EVENT2"], $arFile["STAT_EVENT3"]);
		$_SESSION["player_files"][$_REQUEST["id"]]["WAS_STAT_EVENT"] = true;
	}

	if(
		$arFile["SHOW_COUNTER_EVENT"]
		&& !$arFile["WAS_SHOW_COUNTER_EVENT"] //not yet for this session
		&& CModule::IncludeModule('iblock')
	)
	{
		CIBlockElement::CounterInc($_REQUEST["id"]);
		$_SESSION["player_files"][$_REQUEST["id"]]["WAS_SHOW_COUNTER_EVENT"] = true;
	}
}
CMain::FinalActions();