vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Howto Show threads from the beginning, sorted by Last Post Time in Descending Order? (https://vborg.vbsupport.ru/showthread.php?t=240421)

nyunyu 04-14-2010 05:20 AM

Howto Show threads from the beginning, sorted by Last Post Time in Descending Order?
 
My forum is currently show threads from the beginning, sorted by Thread Title in Ascending order by default.

How can I change default setting to:

Show threads from the beginning, sorted by Last Post Time in Descending Order?

I need this setting to be permanent, i.e. this setting will be applied to all users. I believe I can run sql query correct? Can anyone give me the query to do this?

Many thanks.

borbole 04-14-2010 02:01 PM

Quote:

Originally Posted by nyunyu (Post 2020909)
My forum is currently show threads from the beginning, sorted by Thread Title in Ascending order by default.

How can I change default setting to:

Show threads from the beginning, sorted by Last Post Time in Descending Order?

I need this setting to be permanent, i.e. this setting will be applied to all users. I believe I can run sql query correct? Can anyone give me the query to do this?

Many thanks.


You can change that on a forum per forum basis at Forum Manager-Edit Forum and the options you need are:

Default View Age

Default Sort Field

Default Sort Order


or you can change them for all the forums in one fell swoop at the phpmyadmin in the cp of your host by running the following queries:

To show threads from the begin:

Code:

UPDATE forum SET daysprune = -1


To sort by Last Post Time:

Code:

UPDATE forum SET defaultsortfield = 'lastpost';

Whereas to sort in a descending order:

Code:

UPDATE forum SET defaultsortorder = 'desc';


If your db tables have a prefix you should include that as well in the query. Hope it helps.

nyunyu 04-14-2010 04:00 PM

Thanks borbole, that does the trick!
Although I see no difference after I did that, I remember that I need to update the counter after any changes.

Admin CP -> Import & Maintenance -> Update Counters -> Rebuild Forum Information

Thanks again.

borbole 04-14-2010 04:08 PM

You are welcome. Glad to have been of help.

markoroots 05-29-2014 04:53 PM

Thanks guys. :)
You have also helped me. :) And sure many others. ;)

markoroots 11-07-2014 02:48 PM

Sorry but if I'm using a prefix where must be added??
Thanks in advance.

kh99 11-07-2014 03:10 PM

Quote:

Originally Posted by markoroots (Post 2521814)
Sorry but if I'm using a prefix where must be added??
Thanks in advance.

If you have a table prefix, it would go before forum. for example, if your prefix is 'vb', then you'd need something like this:
Code:

UPDATE vbforum SET defaultsortorder = 'desc';


All times are GMT. The time now is 02:38 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.01015 seconds
  • Memory Usage 1,725KB
  • 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
  • (2)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (7)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