Ok, my need was similar and I experimented to find a way to implement what you are looking for.
In this example forum ID 77 will be changed so that threads are listed in creation order.
You need to change TWO hooks.
forumdisplay_start:
Code:
if ($forumid == 77) {
$vbulletin->GPC['sortfield'] = 'Custom';
}
forumdisplay_sort:
Code:
if ($forumid = 77) {
$sqlsortfield = "thread.dateline";
$sqlsortorder = "asc";
$handled = true;
}
I suppose you could also code this like:
forumdisplay_start:
Code:
if ($forumid == 77) {
$vbulletin->GPC['sortfield'] = 'dateline';
}
forumdisplay_sort:
Code:
if ($vbulletin->GPC['sortfield'] == 'dateline';) {
$sqlsortfield = "thread.dateline";
$sqlsortorder = "asc";
$handled = true;
}
Then you only need to change the code in forumdisplay_start if you wanted multiple forums to use "dateline" as the sort.
I'm sure there's a more elegant way to get what you want to achieve and I'm looking forward to seeing other peoples solutions.
The problem with my solution is that it's quick, dirty and doesn't allow the user to select the sort fields / orders from the normal menu.
Sussed it, leave forumdisplay_sort: as above but change:
forumdisplay_start:
Code:
if ($_REQUEST['sort'] == '') {
if ($forumid == 77) {
$vbulletin->GPC['sortfield'] = 'dateline';
}
}