Booost This
11-05-2007, 06:49 AM
Hey guys, looking for a little programming help. I am trying to edit the forumdisplay.php to make all my forums/threads/etc show up alphabetical order, descending order (a,b,c,d,e,.,.,.).
I have located the code, just unsure what changes need to be made? There seems to be 2 different default sort options in the code?
// default sorting methods
if (empty($sortfield))
{
$sortfield = $foruminfo['defaultsortfield']; <-- Edit?
}
if (empty($vbulletin->GPC['sortorder']))
{
$vbulletin->GPC['sortorder'] = $foruminfo['defaultsortorder']; <-- Edit?
}
// look at sorting options:
if ($vbulletin->GPC['sortorder'] != 'asc')
{
$sqlsortorder = 'DESC';
$order = array('desc' => 'selected="selected"');
$vbulletin->GPC['sortorder'] = 'desc';
}
else
{
$sqlsortorder = '';
$order = array('asc' => 'selected="selected"');
}
switch ($sortfield)
{
case 'title':
$sqlsortfield = 'thread.title';
break;
case 'lastpost':
$sqlsortfield = 'lastpost';
break;
case 'replycount':
case 'views':
case 'postusername':
$sqlsortfield = $sortfield;
break;
case 'voteavg':
if ($foruminfo['allowratings'])
{
$sqlsortfield = 'voteavg';
break;
}
case 'dateline':
$sqlsortfield = 'thread.dateline';
break;
// else, use last post
default:
$handled = false;
($hook = vBulletinHook::fetch_hook('forumdisplay_sort')) ? eval($hook) : false;
if (!$handled)
{
$sqlsortfield = 'lastpost'; <-- Edit?
$sortfield = 'lastpost'; <-- Edit?
}
I think i need to change all or just one/two of the options highlighted, just unsure what to change them to? Any help would be appreciated.
I did a lot of experimentation buy I only got as far as sorting them in ascending order (backwards, e,d,c,b,a). I am a newb, forgive me. :)
I have located the code, just unsure what changes need to be made? There seems to be 2 different default sort options in the code?
// default sorting methods
if (empty($sortfield))
{
$sortfield = $foruminfo['defaultsortfield']; <-- Edit?
}
if (empty($vbulletin->GPC['sortorder']))
{
$vbulletin->GPC['sortorder'] = $foruminfo['defaultsortorder']; <-- Edit?
}
// look at sorting options:
if ($vbulletin->GPC['sortorder'] != 'asc')
{
$sqlsortorder = 'DESC';
$order = array('desc' => 'selected="selected"');
$vbulletin->GPC['sortorder'] = 'desc';
}
else
{
$sqlsortorder = '';
$order = array('asc' => 'selected="selected"');
}
switch ($sortfield)
{
case 'title':
$sqlsortfield = 'thread.title';
break;
case 'lastpost':
$sqlsortfield = 'lastpost';
break;
case 'replycount':
case 'views':
case 'postusername':
$sqlsortfield = $sortfield;
break;
case 'voteavg':
if ($foruminfo['allowratings'])
{
$sqlsortfield = 'voteavg';
break;
}
case 'dateline':
$sqlsortfield = 'thread.dateline';
break;
// else, use last post
default:
$handled = false;
($hook = vBulletinHook::fetch_hook('forumdisplay_sort')) ? eval($hook) : false;
if (!$handled)
{
$sqlsortfield = 'lastpost'; <-- Edit?
$sortfield = 'lastpost'; <-- Edit?
}
I think i need to change all or just one/two of the options highlighted, just unsure what to change them to? Any help would be appreciated.
I did a lot of experimentation buy I only got as far as sorting them in ascending order (backwards, e,d,c,b,a). I am a newb, forgive me. :)