Back to vBulletin 3.0 Add-Ons

Sort forum by thread date
Mod Version: 1.00, by tgmorris

This modification is in the archives.
vB Version: 3.0.6 Rating: (0 vote - 0 average) Installs: 4
Released: 27 Jan 2005 Last Update: Never Downloads: 0
Not Supported  

A few people have been asking for a way to sort forums by the date the thread was originally posted. Here's a quick change to allow the capability to sort the threads in a forum in either ascending or descending date order.

I've tested this against 3.0.3 but it should work fine using 3.0.6.

In forumdisplay.php find the following and insert the highlighted line.
Code:
        switch ($sortfield)
        {
                case 'title':
                        $sqlsortfield = 'thread.title';
                        break;
                case 'lastpost':
                case 'replycount':
                case 'views':
                case 'postusername':
                case 'dateline':
                        $sqlsortfield = $sortfield;
                        break;
                case 'voteavg':
                        if ($foruminfo['allowratings'])
                        {
                                $sqlsortfield = 'voteavg';
                                break;
                        } // else, use last post
                default:
                        $sqlsortfield = 'lastpost';
                        $sortfield = 'lastpost';
        }
In the FORUMDISPLAY template find the following and add the highlighted portion. Be sure to add the " / " on the line above newly added line.
Code:
	<td class="thead" width="100%">
		<if condition="$show['threadratings']"><span style="float:$stylevar[right]"><a href="$sorturl&amp;order=desc&amp;sort=voteavg">$vbphrase[rating]</a> $sortarrow[voteavg]</span></if>
		<a href="$sorturl&amp;order=asc&amp;sort=title">$vbphrase[thread]</a> $sortarrow[title] /
		<a href="$sorturl&amp;order=asc&amp;sort=postusername">$vbphrase[thread_starter]</a> $sortarrow[postusername] / 
		<a href="$sorturl&amp;order=asc&amp;sort=dateline">Thread Date</a> $sortarrow[dateline]
	</td>
As always, back up any files you will be changing.

What it does:

Adds the " / Thread Date" link to the fourm header - see the attached image. This allows the forum to be sorted by ascending date. Once selected the standard sort arrow will appear and allow the order to be changed to descending.

Download

No files for download.

Screenshots

 


vblts.ru supports vBulletin®, 2022-2024