M
M
Maxim Morozov2020-02-08 15:02:12
1C-Bitrix
Maxim Morozov, 2020-02-08 15:02:12

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"], '&nbsp;', RusEnding($resElement["SHOW_COUNTER"], "Человек интересовался", "Человека интересовались", "Человек интересовались");?>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2020-02-08
@morozoffmaks

No element. You can pages using the web analytics module

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question