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.

                010101 flarum search function results are not listed after plugin update.

                  mekici Search works ok for me. Just in case this is what you’re experiencing... due to performance issues for the time being, you can’t search post titles in Flarum. Your keyword has to match something in the body of a post. But, this has nothing to do with this views extension.

                  But, anyone out there, hopefully someone can duplicate my issue mentioned above... with the latest version of this views extension installed, and the abbreviation setting turned on, and the Pages extension with a page created, go to the page. Then click the built in back button top left of forum. Do the discussions load? Mine do not. I deactivated all extensions but these couple too. Still not fixed. Sigh.

                    • [deleted]

                    • Edited

                    010101 But, anyone out there, hopefully someone can duplicate my issue mentioned above... with the latest version of this views extension installed, and the abbreviation setting turned on, and the Pages extension with a page created, go to the page.

                    I can replicate this exact issue. As you state, it's evident when the number abbreviation is enabled.

                    In addition, it looks like (according to the pace.js progress bar I have) that the page is being loaded twice.

                    MichaelBelgium

                    http://www.bytecheck.com/

                    When I install the Discussion Views plugin, the site opens automatically 1-2 seconds late.
                    You can check this with gtmetrix and pagespeed.
                    What is this problem caused by?

                    I had to disable the plugin just because of this problem 🙁

                      @MichaelBelgium the issue indeed easy to replicate, just make sure you're going straight to the page URL at first (and not for instance using the Links extension instead).

                      it looks like your discussionviews relationships are not loaded if the page doesn't load with any discussion data. I don't have this issue by appending a relationship to ForumSerializer / ShowForumController instead

                      @[deleted] only a negligible 40ms difference in load speeds (its literally only a few kilobytes difference in js) or anything that would indicate files are being loaded twice on my end

                      • [deleted]

                      MichaelBelgium My issue is that sometimes it only shows the eye and not the number. When i go on the post again and back i see the number again.

                        MichaelBelgium 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 @Alshain @[deleted] @zyronix @[deleted]
                        So what do you guys think about "inheriting views data from the old version"? Don’t you care about the uncomfortableness of counting views from zero after the update? 🙁