Answer the question
In order to leave comments, you need to log in
How to display the number of views of the "1s Bitrix" element for a certain period?
This is how we get the number of views of the element for all time.
Question: How to display views for a certain time?
For example: Display the number of views for 1 or 2 months.
<?$resElement = CIBlockElement::GetByID($arResult['ID'])->GetNext();
$value = $resElement;
function RusEnding($n, $n1, $n2, $n5) {
if($n >= 11 and $n <= 19) return $n5;
$n = $n % 10;
if($n == 1) return $n1;
if($n >= 2 and $n <= 4) return $n2;
return $n5;
}
echo $resElement["SHOW_COUNTER"], ' ', RusEnding($resElement["SHOW_COUNTER"], "Человек интересовался", "Человека интересовались", "Человек интересовались");?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question