• Модуль: socialnetwork
  • Путь к файлу: ~/bitrix/modules/socialnetwork/lib/component/loglist/counter.php
  • Класс: BitrixSocialnetworkComponentLogListCounter
  • Вызов: Counter::setLogCounter
public function setLogCounter(&$result): void
{
	$params = $this->getComponent()->arParams;

	$result['LOG_COUNTER'] = 0;
	$result['LOG_COUNTER_IMPORTANT'] = 0;

	if (
		$params['SET_LOG_COUNTER'] !== 'Y'
		|| !Util::checkUserAuthorized()
	)
	{
		return;
	}

	$counters = CUserCounter::getValues($result['currentUserId'], SITE_ID);

	if (isset($counters['BLOG_POST_IMPORTANT']))
	{
		$result['LOG_COUNTER_IMPORTANT'] = (int)$counters['BLOG_POST_IMPORTANT'];
	}

	if (isset($counters[$result['COUNTER_TYPE']]))
	{
		$result['LOG_COUNTER'] = (int)$counters[$result['COUNTER_TYPE']];
	}
	else
	{
		$this->setEmptyCounter(true);
		$result['LOG_COUNTER'] = 0;
	}
}