Lack of interest sort thread replies by 'most likes'

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

gib

Well-known member
I know there have been a few posts about sorting threads by likes, but it would be useful to be able to sort thread replies by 'most likes'

There are regular thread posts on one of my forums for caption competitions.
Users are asking if there is a way to vote or show the most liked replies at the top, with a secondary sort on chronological order
 
Upvote 2
This suggestion has been closed. Votes are no longer accepted.
Excellent idea !
There would be so many uses to this functionality.
I could see many uses for this at xenforo.com itself.

Should this be an addon or a core feature ?
Probably an addon.
 
You can use order by first post likes:

http://xenforo.com/community/forums/have-you-seen/?order=first_post_likes&orderDirection=DESC

HTML:
public function prepareThreadFetchOptions(array $fetchOptions)
    {
        $selectFields = '';
        $joinTables = '';
        $orderBy = '';
 
        if (!empty($fetchOptions['order']))
        {
            $orderBySecondary = '';
 
            switch ($fetchOptions['order'])
            {
                case 'title':
                case 'post_date':
                case 'view_count':
                    $orderBy = 'thread.' . $fetchOptions['order'];
                    break;
 
                case 'reply_count':
                case 'first_post_likes':
                    $orderBy = 'thread.' . $fetchOptions['order'];
                    $orderBySecondary = ', thread.last_post_date DESC';
                    break;
 
                case 'last_post_date':
                default:
                    $orderBy = 'thread.last_post_date';
            }
 
Top Bottom