vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Thread Sorting (https://vborg.vbsupport.ru/showthread.php?t=36972)

MarkB 04-04-2002 08:39 AM

Thread Sorting
 
Hi,

Is it possible to hack forumdisplay so it will sort threads based solely on their first post date?

Also, is there a '10 recent posts' hack that displays them, again, based on the date they were started not by the date of their last post?

Thx :)
Mark

Admin 04-04-2002 10:15 AM

In forumdisplay.php replace:
Code:

    $sortfield='lastpost';
}
if ($sortfield=="voteavg" and !$foruminfo[allowratings]) {
  $sortfield="lastpost";
}

with:
Code:

    $sortfield = 'dateline';
}
if ($sortfield == 'voteavg' and !$foruminfo['allowratings']) {
  $sortfield = 'dateline';
}


MarkB 04-04-2002 10:28 AM

Thanks Chen, is there a way to do it in only certain forums?

Admin 04-04-2002 10:31 AM

I saw that coming. ;)
https://vborg.vbsupport.ru/showthrea...threadid=34556

MarkB 04-04-2002 11:34 AM

LOL I actually posted in that thread :o Talk about a bad memory... :) Thanks! :)

MarkB 04-04-2002 10:30 PM

Ok, I installed that other hack, but it doesn't work for me. I'm setting the sort field to 'dateline', as I figured that was the required field based on your code above, but it sorts them as per normal...

Does 'dateline' reflect the original posting date, or does it change whenever someone posts to the thread?

Admin 04-05-2002 05:22 AM

dateline, in most vB tables, means "when the record was created". In this example, "when the thread was created". lastpost updates every time.

MarkB 04-05-2002 06:43 AM

Hmm... so basically, if I set dateline to be the sort field, it should list them by start date - which obviously isn't working in this case? :(

Admin 04-05-2002 06:47 AM

Ok, in forumdisplay.php replace:
Code:

  case 'postusername':
  case 'voteavg':

with:
Code:

  case 'postusername':
  case 'voteavg':
  case 'dateline':


MarkB 04-05-2002 06:56 AM

Champion :) Cheers guv!


All times are GMT. The time now is 08:46 PM.

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.01006 seconds
  • Memory Usage 1,733KB
  • 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
  • (4)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete