PDA

View Full Version : Chronological Thead Display By Start Date


Neo
03-03-2002, 10:00 PM
Works with 2.2.0 and up!

This hack was suggested by Lionel at this thread. https://vborg.vbsupport.ru/showthread.php?s=&threadid=35707

Its a small hack but it does what he wants.

##### In forumdisplay.php Replace #####


// look at sorting options:
if (!isset($sortorder)) {
$sortorder = "";
}
if (!isset($sortfield)) {
$sortfield = "";
}


### with ###


// look at sorting options:
if ($foruminfo[forumid]=="xx" || $foruminfo[forumid]=="xx") {
if (!isset($sortorder)) {
$sortorder = "asc";
}
if (!isset($sortfield)) {
$sortfield = "asc";
}
} else {
if (!isset($sortorder)) {
$sortorder = "";
}
if (!isset($sortfield)) {
$sortfield = "";
}
}


to set it for a certain forum edit this code like


if ($foruminfo[forumid]=="xx" || $foruminfo[forumid]=="xx") {


xx would be the number of the forum you want to have this be used on.

Lionel
03-04-2002, 08:03 PM
Neo, it does exactly what I was looking for. Upon entering the forum, the thread are properly sorted. :up:

Neo
03-05-2002, 07:43 AM
No prob man. I am happy to serve.

Admin
03-05-2002, 02:21 PM
Why are you setting $sortfield to 'asc' as well?

Neo
03-05-2002, 03:26 PM
He wanted to have it so that the first made was at the top instead of the bottom... so the newest one would start or be placed at the end of the page... and as you know ASC is a MySQL command.

Admin
03-05-2002, 04:03 PM
$sortfield is the column to sort by, not the order. $sortorder holds the order (ASC/DESC).

Neo
03-05-2002, 04:50 PM
Yeah... thats what I ment to say.

Admin
03-05-2002, 04:53 PM
And I'm asking why are you setting $sortfield (not $sortorder) to ASC?

SystemLogic
03-05-2002, 09:43 PM
Works perfectly, thanks a lot bud!

SystemLogic
03-09-2002, 05:30 AM
Hmm odd, I thought it worked, but it's actually putting the replies back at the top even though the start date is much earlier then the most recent post.

Tim Wheatley
03-09-2002, 10:01 AM
Two questions:
a) Is this working??

b) How do I have the newest at the top?

Lionel
03-09-2002, 10:12 AM
It's working for me. It is automatically sorting them in the desired order. Member can change order if he wants but it will always revert back to set order next time he enters forum again.

Tim Wheatley
03-09-2002, 12:43 PM
Ok but can I change it so that default is newest at top?

Lionel
03-09-2002, 12:45 PM
I guess you'll have to replace asc with desc

Tim Wheatley
03-09-2002, 01:04 PM
No that won't work for me. It just switches back to the normal 'last post' listing. I want it going by first post. :)

SystemLogic
03-09-2002, 05:02 PM
asc and desc work for me, but like I said, now when I post a reply it goes to the top rather then staying where it is....Any ideas at all?

Neo
03-10-2002, 01:23 PM
Leave them both at asc.. it worked for me just fine like that.

SystemLogic
03-10-2002, 04:16 PM
It's actually not working for me for some odd reason..... http://www.slcentral.com/boards/forumdisplay.php?s=&forumid=48

Neo
03-10-2002, 04:44 PM
what version of vb are you using?

SystemLogic
03-10-2002, 05:26 PM
2.2.1

Tim Wheatley
03-10-2002, 05:32 PM
I'm using 2.2.2, and it has installed, and orders differently when I change it, but as soon as a reply is made to an old thread, it ignores everything I've set and returns to the board default...

SystemLogic
03-10-2002, 05:42 PM
I think mine is doing the same thing as Tim.... You would think that the makers of VB would add in a "sort by original post date" in the first place....

Tim Wheatley
03-18-2002, 06:36 PM
Same problem with 2.2.4 too.

Neo
03-18-2002, 07:04 PM
Hmm... it works for me... I will look into it.

Pinocchi
04-13-2002, 05:14 PM
Hi,

I was looking for something like this as well and your first suggestion really got me going. What I've got now is an addition of two columns from the forum table and some changes at the admin area. Like this I can set the sort field myself for every single forum as well as descending or ascending.

The only thing I'm still looking for is a function to grab all the different columns in a table.

If someone would know of such a function/ select query, pleas let me know as I can make the field a selection field in the admin area.

Regards,

Pinocchi

Bald Bouncer
04-13-2002, 05:39 PM
is there a way to use this sorting by Thread post dates?

Neo
04-13-2002, 11:35 PM
I believe there would be :)

pokerie
09-08-2006, 04:09 AM
Hi there,
I've recently created a thread I want stickied and the first post of it is to be the intro to the thread. I want to merge older threads into the same thread and have them displayed "after" the intro. I want to merge a few threads into the one but I'm afraid with the chronological order of things, the posts could be all over the place. Is there any way just to add them non chronologically and more threadly (if that's a word:))

Any feedback would be appreciated.