Skip to main content ↑ ↓
2.0 - Topic list sorting Started by ScottJB · · Read 185 times 0 Members and 1 Guest are viewing this topic.

2.0 - Topic list sorting

When viewing the boards on my site, all the topics are displaying with the latest at bottom.
No matter how I click to view, it still shows last post at bottom.
Even pinned topics are not grouped at top.

Any ideas on what's with this, @Spuds ?

screencapture-scottjbrousseau-index-php-2026-09-20-04_05_48.png

Re: 2.0 - Topic list sorting

Reply #1 –

If I recall correctly that was the following bug:  in MessageIndex.subs.php   around line 130
find:
Code: [Copy]
	$topics = $request->fetch_all();
$request->free_result();

return $topics;
replace with
Code: [Copy]
	// Now we fill the above array, maintaining the index order.
while (($row = $request->fetch_assoc()))
{
$topics[$row['id_topic']] = $row;
}
$request->free_result();

return $topics;

Re: 2.0 - Topic list sorting

Reply #2 –

Gave me an error:

Unclosed '{' on line 36

EDIT:

I see why, code you said to replace had more than you did:

Code: [Copy]
$topics = $request->fetch_all();
$request->free_result();
}

return $topics;

Means, if I'm not mistaken, I need to do this:

Code: [Copy]
	// Now we fill the above array, maintaining the index order.
while (($row = $request->fetch_assoc()))
{
$topics[$row['id_topic']] = $row;
}
$request->free_result();
}
return $topics;

And, Great Success!
Last Edit: September 20, 2026, 10:15:31 am by ScottJB