• Модуль: advertising
  • Путь к файлу: ~/bitrix/modules/advertising/classes/general/advertising.php
  • Класс: CAdvBanner_all
  • Вызов: CAdvBanner_all::CalculateTimeProgress
static function CalculateTimeProgress($arBanner)
{
	$dt = CAdvBanner_all::__innerExtractBitrixDates($arBanner);

	$stmpnow = time();
	$dtformat = "DD.MM.YYYY HH:MI:SS";
	$stmpfirst = MakeTimeStamp($dt["first"], $dtformat);
	$stmpfrom = MakeTimeStamp($dt["from"], $dtformat);
	$stmpto = MakeTimeStamp($dt["to"], $dtformat);

	// Check if FirstShowDate valid, then use it.
	if ($stmpfirst>0 and $stmpfirst>=$stmpfrom and $stmpto>$stmpfirst)
	{
		$stmpfrom = $stmpfirst;
	}

	$stmpnow -= $stmpfrom;
	$diff = CAdvBanner_all::CalculateTimeDiff($arBanner);
	if ($stmpnow <= 0 or !$diff) return 0;

	return $stmpnow/$diff;
}