vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   How do I make posts in certain threads appear in reverse order ? (https://vborg.vbsupport.ru/showthread.php?t=131141)

Marcel Lee 11-09-2006 01:40 PM

How do I make posts in certain threads appear in reverse order ?
 
I want to make it so that the posts in certain threads appear in reverse order; in that new posts would appear at the beginning instead of the end of the thread.

I'm thinking it should be a matter of simply using a "if/then" statement for those particular threadids, making a special forum where threads go like that by default or something, but I dont know.

Analogpoint 11-17-2007 05:22 PM

Create a new forum and set the Default sort field to Thread start time, and the Default sort order to Ascending.

Marcel Lee 11-17-2007 07:34 PM

I just tried that and it doesn't work.

What I want to do is make it so that the posts in certain threads appear in reverse order, the way they do when you change the Thread Display Mode to Newest First on the Edit Options page in your User CP.


Do I have to wait till November 2008 for another reply??

Analogpoint 11-19-2007 08:04 PM

I'm sorry I mis-read. The instructions I gave would be for threads in a forum, not posts in a thread.

A plugin on the showthread_getinfo hook with the following code should do the job.
PHP Code:

if ($threadinfo['threadid'] == 123)
{
   
$postorder 'DESC';



Marcel Lee 11-20-2007 04:19 PM

Wow, it worked! Thanks. :D

Now I just need to know how to do it for several threads, instead of just one. I tried separating the thread id numbers by commas and got an error. I also separated them by spaces and got an error. Should I just paste the entire code again and again for every one?

I'm eventually going to do it for hundreds of threads, so let me know the best way to go about it.

Analogpoint 11-20-2007 04:39 PM

Just change the code to this: You can add as many threadids as you want, separated by commas.
PHP Code:

if (in_array($threadinfo['threadid'], array(324567823498745621))
{
   
$postorder 'DESC';


You could also create a full mod that would allow you to set a thread to show in this order when you create it, but that would be more involved.


All times are GMT. The time now is 08:22 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.01020 seconds
  • Memory Usage 1,722KB
  • 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
  • (2)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)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