Post Reply 
Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY]
02-13-2017, 05:29 PM (This post was last modified: 02-13-2017 05:30 PM by Han.)
Post: #5
RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY]
In the file forumdisplay.php at line 697 is the following code:

Code:
    if($sortordernow != "desc")
    {
        $page_url .= "{$q}{$and}order={$sortordernow}";
        $q = '';
        $and = "&";
    }

The problem is that the default sort is ascending (for software libraries) as set by the administrator for this particular forum. However, the code is programmed to assume that the default mode is always descending, so that URLs with a descending sort (as selected by readers) do not have order=desc added to them. But when the URL is processed and since the default behavior for non-explicit sort order is to use ascended sort (set by the administrator), the user never gets the descended sort.

Therein lies the problem -- the admin-selected default is 'asc' whereas the assumed default is 'desc'.

I am sure that by simply removing the test and making the sort order always explicit we will solve this issue. I would change the above to:

Code:
        $page_url .= "{$q}{$and}order={$sortordernow}";
        $q = '';
        $and = "&";

(remove the surrounding brackets and if statement)

Graph 3D | QPI | SolveSys
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Sorting posts in this section of forum is broken (?) [HP PRIME SOFTWARE LIBRARY] - Han - 02-13-2017 05:29 PM



User(s) browsing this thread: 3 Guest(s)