Lack of interest Swipe to next thread

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.

Alpha1

Well-known member
On most news websites that I visit its possible to swipe to the next article. It has become pretty common functionality. It would be handy if it were possible on xenforo as well.

Instead of having to go back to new post and then going to the next thread to go straight to the next thread by swiping.
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
I believe next and previous functionality has been suggested before due to not knowing how you would determine the next thread. Would it be the most recently posted in, the most recently created after that one (thread id +1), most recent posted in the same node, etc
 
Thats where admin settings come in. Just leave that part up to the admin to decide.
I would not have to think twice about how to set it, but I am sure different admins will have different preferences on this.
 
I manged to make something that worked.

Under XenForo_Model_Thread i added this
PHP:
public function getPrevNexLink($threadId, $nodeId, $previous, array $fetchOptions = array())
    {
        /* https://xenforo.com/community/threads/swipe-to-next-thread.87581/ */
        $joinOptions = $this->prepareThreadFetchOptions($fetchOptions);

        if ($previous == false)
        {
            return $this->_getDb()->fetchRow('
            SELECT thread.*
                ' . $joinOptions['selectFields'] . '
            FROM xf_thread AS thread
            ' . $joinOptions['joinTables'] . '
            WHERE thread.thread_id = (SELECT MIN(thread.thread_id) FROM xf_thread AS thread WHERE thread.thread_id > ' . $threadId . ' AND thread.node_id = ' . $nodeId. ')
            AND thread.node_id = ' . $nodeId);
        }
        else
        {
            return $this->_getDb()->fetchRow('
            SELECT thread.*
                ' . $joinOptions['selectFields'] . '
            FROM xf_thread AS thread
            ' . $joinOptions['joinTables'] . '
            WHERE thread.thread_id = (SELECT MAX(thread.thread_id) FROM xf_thread AS thread WHERE thread.thread_id < ' . $threadId . ' AND thread.node_id = ' . $nodeId .')
            AND thread.node_id = ' . $nodeId);
        }
    }



Under XenForo_ControllerPublic_Thread, inside actionIndex function and under $viewParams i added this code
PHP:
'previousLink' => XenForo_Link::buildPublicLink('threads', $threadModel->getPrevNexLink($thread['thread_id'], $thread['node_id'], true)),
            'nextLink' => XenForo_Link::buildPublicLink('threads', $threadModel->getPrevNexLink($thread['thread_id'], $thread['node_id'], false)),
and it works fine if used under templates :)
 
This would be really nice for the new posts link. I feel the default should be the next thread in the same new posts id list as that's how it currently works when you back out of a thread to the new posts page to move onto the next one.

If your in a thread having navigated to it by node, then the next thread would be the next one in the list however you had the node list ordered before you opened the thread.
 
In IE and Chrome, swipe means back (or forward). I don't know about Firefox.

This is a great suggestion, but I'm afraid it will become problem.
 
In IE and Chrome, swipe means back (or forward). I don't know about Firefox.

This is a great suggestion, but I'm afraid it will become problem.
On what platform? I'm swiping left to right across this whole thread and its doing nothing. A long time ago in chrome that would happen. Especially the tab change gestures. I get nothing on Chrome v39 and Android 5.

IE on a tablet I'm assuming would be your use case?
 
Back
Top Bottom