14 days later

Hi, @MichaelBelgium!
Thanks for the great addition!
How did you decide on the number of sorting points? I think there are too many of them to be useful.

Is there any way to hide the sorting elements?

2 months later

Is there any way to show unique visitors count only?

5 days later

Im waiting for unique tracker. You can add 2 option one of them unique tracker one of them normal tracker and people can choose.

  • Opu likes this.

I'm planning this:

I expect the database changes would be done by end of january - first I got exams and at work its a busy time.

6 days later

Versioning update

I've stepped down from the odd "v0.1.0-betax" versioning for this extension.
Please reinstall the extension to prepare for upcoming releases (like v3.0.0).

(Not sure if composer removeis needed)
composer require michaelbelgium/flarum-discussion-views

After update the extension, the number of discussion views displayed on the forum homepage has become “0”, but the original records are all in the "view_count" field of the database and have not become “0”. Why is the homepage still showing 0?
【Flarum homepage👇

【Database👇

In addition, after I visit a discussion, the database 'view_count' field of the discussion i visited will clear the original count and restart counting.

And I found that the 'change views' is nolonger exist... So we only can change views by change database self?

@Littlegolden the numbers will be reset when a discussion gets a new viewer. Ghe "view_count" field gets automaticly updated when a viewer browses to the discussion. So you can't really change it + that field is only used for the (un)popular ordering on the homepage.

And I found that the 'change views' is nolonger exist... So we only can change views by change database self?

You only can remove all from now on, because the relationship between discussion and a discussion view. (records from discussion_views)

    MichaelBelgium Well, it's a pity that the previous counts were reset. . .

    But it seems technically possible to inherit the data before the update, right? Or modify the data. . . Then I would like to ask, is there a relative time range for this "traffic-based" judging whether a discussion is popular? Is it to monitor the traffic during a week to determine whether it is popular? If you judge the popularity according to the total number of page views, it will not be very accurate. For example, a post was viewed by many people posted last year, but no one is currently viewing it.

      Littlegolden But it seems technically possible to inherit the data before the update, right?

      Honestly i could've done that by inserting x rows for a discussion where the view_count = x but it wouldn't be accurate as I don't know which users have been viewing it and their ip.

      Littlegolden Then I would like to ask, is there a relative time range for this "traffic-based" judging whether a discussion is popular? Is it to monitor the traffic during a week to determine whether it is popular? If you judge the popularity according to the total number of page views, it will not be very accurate. For example, a post was viewed by many people posted last year, but no one is currently viewing it.

      There's no difficult algorithm behind the (un)popular order. It's, like you said, according to the number of page views. It just orders it descending. You do have a point about your example. In this case it's like "popular of all time"

        MichaelBelgium Can it be handled like this?
        After the upgrade, the previous views data is still retained, but the guest ip and guest username are only recorded after the update, and the guest list prompts: "Only support viewing of view records after {month} {day} {year}." (The date is the date one person updated the extension.) After all, old views data is indeed more important.

          MichaelBelgium There seems to be a conflict which causes the discussion list to not load sometimes. Mainly, with the pages extension, if I go to a page then use the top bar’s back button, I go back to all discussions but the loading spinner spins forever. No discussions load. As soon as I disable this extension it’s fixed.

          Oddly, nothing in my Flarum error logs.

          Edit: It's the number abbreviation setting. Posted the JS error at GitHub.

            Littlegolden After the upgrade, the previous views data is still retained, but the guest ip and guest username are only recorded after the update,

            I feel like im too late for that now, if i add a migration that transforms the amount view_count to rows in database_views - which is perfectly possible - what about the people who already updated? It's too late for them

            Littlegolden ... and the guest list prompts: "Only support viewing of view records after {month} {day} {year}."

            Can u elaborate on the "guest list prompts"? In what way? What do you mean exactly?

            After the upgrade, the previous views data is still retained, but the guest ip and guest username are only recorded after the update

            Yeah, that either way because there's no way to know who viewed the discussions in the past. It's inaccurate data in my opinion and I have no idea if people rather want inaccurate data than no data.

            010101 I need more people with this issue and know how to reproduce it ☹️ For now your temporary solution is to disable the abbreviation setting

              MichaelBelgium I need more people with this issue and know how to reproduce it ☹️ For now your temporary solution is to disable the abbreviation setting

              That’s understandable. Not that this helps solve it but just so you know I used the old version of this extension for a long time with no issues. It’s just something about 3.0 my Flarum installation doesn’t like. I guess I can try reinstalling an old version.