MyBB Hacks

Full Version: Issue with sorting forum by Last Post
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
http://harajuju.net/Forum-Haralooks?date...http://harajuju.net/Forum-Haralooks?datecut=0&sortby=lastpost&

When you try to go to the next page, the sorting will be reset to the forum default, which is by thread creation date. I suspect this is because MyBB does not think it needs to append the sorting options to the next page button because it is the board default, even though we are using a different default sorting option with xThreads.
lastpost sorting is stock MyBB behaviour.  I suspect you're using a custom link rather than the multipage setup, so you need to stick the variables in yourself.
I believe {$page_url} should do it.  Not sure if different with Google SEO URLs.

If you use XThreads filtering, it currently doesn't really expose a nice way to append those in.  You may be able to work out something with

Code:
<func htmlspecialchars>{$xthreads_forum_filter_args}</func>

though it's a ilttle dodgy.

I am using {$page_url} actually. Works for all sorting except when sorting by Last Post.
Maybe because MyBB uses the sortby url only if the sortby is not by the lastpost? So, when you sort threads by the lastpost, the sortby url won't be appended to the $page_url.
forumdisplay.php

PHP Code:
if($sortby != "lastpost")
{
	$page_url .= "{$q}{$and}sortby={$sortby}";
	$q = '';
	$and = "&";
}

Yes, that must be the issue. What should I change it to?
Try from:

PHP Code:
if($sortby != "lastpost")


to:

PHP Code:
if($sortby)

. . . . . . . . .

PHP Code:
if(($foruminfo['defaultsortby'] != "" && $sortby != $foruminfo['defaultsortby']) || ($foruminfo['defaultsortby'] == "" && $sortby != "lastpost"))
{
	$page_url .= "{$q}{$and}sortby={$sortby}";
	$q = '';
	$and = "&";
}

That looks better Tongue
If you're feeling generous, you can report it as a MyBB bug.
Yeah, I definitely will. Thanks.
Pages: 1 2
Reference URL's