Sort posts by view as default option for nodes?

jommytonny888

Well-known member
Registered
Joined
May 31, 2022
Messages
166
Points
28

Reputation:

What mod or code can add sort threads by view in forum? I have this only.
 

Attachments

  • Screenshot 2022-09-25 122423.jpg
    Screenshot 2022-09-25 122423.jpg
    43.4 KB · Views: 73

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,514
Points
523

Reputation:

What mod or code can add sort threads by view in forum? I have this only.
jommytonny888How does the filter look like if you are in a forum overview, do you see views there?
Because as default option I do not see views too
 

jommytonny888

Well-known member
Registered
Joined
May 31, 2022
Messages
166
Points
28

Reputation:

How does the filter look like if you are in a forum overview, do you see views there?
Because as default option I do not see views too
BattleKingYes in forum there is views filter ascending/descending...But in node options not...
 
View previous replies…

BattleKing

Spirit of darkness
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P Member
Collaborate
Registered
Joined
May 24, 2020
Messages
3,514
Points
523

Reputation:

Yes in forum there is views filter ascending/descending...But in node options not...
jommytonny888This seems to be explicitly removed by XenForo inside the code in two locations. All of them are protected functions.
PHP:
                'sortOptions' => $forumType->getThreadListSortOptions($forum, true),
PHP:
            $sortOrders = $this->TypeHandler->getThreadListSortOptions($this, true);
            if (!isset($sortOrders[$this->default_sort_order]))
the true is the option, where these two sort options will be removed, this is a public function and could be modified:
PHP:
        if ($forAdminConfig)
        {
            unset($options['view_count'], $options['first_post_reaction_score']);
        }
Anyway it looks like that the sorting function for views do not work as expected, maybe that the reason that they removed it from the admin section.
 

jommytonny888

Well-known member
Registered
Joined
May 31, 2022
Messages
166
Points
28

Reputation:

This seems to be explicitly removed by XenForo inside the code in two locations. All of them are protected functions.
PHP:
                'sortOptions' => $forumType->getThreadListSortOptions($forum, true),
PHP:
            $sortOrders = $this->TypeHandler->getThreadListSortOptions($this, true);
            if (!isset($sortOrders[$this->default_sort_order]))
the true is the option, where these two sort options will be removed, this is a public function and could be modified:
PHP:
        if ($forAdminConfig)
        {
            unset($options['view_count'], $options['first_post_reaction_score']);
        }
Anyway it looks like that the sorting function for views do not work as expected, maybe that the reason that they removed it from the admin section.
BattleKingDoes it work for you correctly? You mentioned you have it
 
Top