PDA

View Full Version : List threads alphabetically for only 1 forum?


Boofo
01-31-2004, 12:13 AM
Is there a way that I can list the threads from a certain forum alphabetically, but only for that forum?

g-force2k2
01-31-2004, 06:24 AM
Boofo,

You can try this code, but I did not test it.

Open forumdisplay.php

Find:

default:
$sqlsortfield = 'lastpost';
$sortfield = 'lastpost';

Relace With:

default:
if ( $foruminfo['forumid'] == $yourforumid ) :
$sqlsortfield = 'thread.title' ;
else :
$sqlsortfield = 'lastpost' ;
$sortfield = 'lastpost' ;
endif ;

replace the variable $yourforumid with forumid of the forum that you want to display it as the default. Hope this helps.

Cheers,
g-force2k2

Boofo
01-31-2004, 07:43 AM
That did the trick. Thank you, sir. ;)

One last thing, is there a way to reverse the sort order? It goes from the largest to the smallest number now. I would like it to go from the smallest to the largest. Do you know what I mean? ;)

Dean C
01-31-2004, 11:45 AM
An even easier way is to make the forum into a link. Then in the url have:

http://www.yoursite.com/forum/forumdisplay.php?f=xx&daysprune=30&order=asc&sort=title

Boofo
01-31-2004, 11:54 AM
An even easier way is to make the forum into a link. Then in the url have:

http://www.yoursite.com/forum/forumdisplay.php?f=xx&daysprune=30&order=asc&sort=title (http://www.yoursite.com/forum/forumdisplay.php?f=xx&daysprune=30&order=asc&sort=title)
But that wouldn't catch it for searches and new posts, would it?

Dean C
01-31-2004, 12:06 PM
Yes but not in default alphabetical order.

Boofo
01-31-2004, 12:14 PM
I need to have it that way anywhere you get to it from the board. ;)

Edit: I got it. I just replaced:

// look at sorting options:
if ($sortorder != 'asc')
{

with:

// look at sorting options:
if ($sortorder != 'asc' AND $foruminfo['forumid'] != '37')
{

and that took care of it. ;)

g-force2k2, I changed the code that you suggested to this:

default:
if ( $foruminfo['forumid'] == '37' ):
$sqlsortfield = 'thread.title';
$sortfield = 'thread.title';
else:
$sqlsortfield = 'lastpost';
$sortfield = 'lastpost';
endif;

That will be ok, right? ;)

vprp
08-30-2005, 09:16 AM
Boofo, I did those template edits to my forumdisplay.php. It works for 2 sub-forums but it doesn't work for 5. Let's say I have 5 sub-forums (ids = 19, 20, 26, 27, 28) that I want sorted alphabetically, how would I code that?

Boofo
08-30-2005, 12:44 PM
Boofo, I did those template edits to my forumdisplay.php. It works for 2 sub-forums but it doesn't work for 5. Let's say I have 5 sub-forums (ids = 19, 20, 26, 27, 28) that I want sorted alphabetically, how would I code that?

What version of vb are you wanting to do this with?

vprp
08-30-2005, 07:10 PM
What version of vb are you wanting to do this with?

I am using vB 3.0.3.

Andreas
08-30-2005, 07:50 PM
naxialys made a Hack for 3.0 which lets you specify default sort Order for each Forum via AdminCP.

Talisman
08-30-2005, 11:52 PM
That sounds like a nice option to have. But what kind of forum would it be that you'd want the posts to be shown in alphabetical order?

:bunny:

vprp
08-31-2005, 06:51 AM
Found it. Thank you for pointing me to the hack. Here's an example of a forum I want sorted alphabetically:

Driver Reviews (http://www.golfrewind.com/forumdisplay.php?f=19)