vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Chronological Thead Display By Start Date (https://vborg.vbsupport.ru/showthread.php?t=35710)

Neo 03-03-2002 10:00 PM

Chronological Thead Display By Start Date
 
Works with 2.2.0 and up!

This hack was suggested by Lionel at this thread. https://vborg.vbsupport.ru/showthrea...threadid=35707

Its a small hack but it does what he wants.

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

PHP Code:

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


### with ###

PHP Code:

// 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

PHP Code:

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/foru...?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.


All times are GMT. The time now is 05:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01097 seconds
  • Memory Usage 1,766KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (3)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete