PDA

View Full Version : I need help to implement new thread sort order


SToP_GAP
10-18-2015, 11:06 PM
I am looking to expand the options for thread sorting, but I can't seem to find where in the code this gets done. Can someone help me out?

For example, if I add a "Solved" button to each thread (which I know how to do), I would like to then offer the option of:

Sort by: "Solved First", "Unsolved First"

I just cannot locate where I would add this extra code.

Thanks :)

Dave
10-19-2015, 07:39 AM
Check the forumdisplay.php file around line 748.
There's a hook called "forumdisplay_sort", which should allow you to change the sort field.

Something like this should work for the hook:

$sqlsortfield = 'solvedcolumn';
$sortfield = 'solvedcolumn';
$handled = true;

Of course you have to add the logic to only sort it when your button is being pressed and such.