vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   change thread sort order? (https://vborg.vbsupport.ru/showthread.php?t=231570)

bluestartech 12-29-2009 03:24 PM

change thread sort order?
 
We have one specific thread that I would like to change the sort order on from descending to ascending. I can change the Default Sort Order of that specific forum, however it does not affect the thread within it.

Is this something that can be done?

we_are_borg 12-29-2009 07:06 PM

Would be nice if you say what version you use vb3.x and vb4 are very different.

vbenhancer 12-29-2009 07:54 PM

actually no, there is no difference whatsoever in the plugin to create for any version of vBulletin...

hook: showthread_getinfo

PHP Code:

if($threadid == 'XXX'$postorder 'ASC'# or 'DESC' depending on your needs 


the logic behind the "no postorder" is that you usually start reading a thread when it started, and when you click the icon "go to last unread post", you are redirected where you were last time... if you force the order, the button will work, but it will require you to scroll back...

bluestartech 12-30-2009 02:06 PM

Excuse my lack of knowledge in this respects. I would like to make it into a plugin like this, but I do not know how to implement the php code section..

<?xml version="1.0" encoding="ISO-8859-1"?>
<plugins>
<plugin active="1">
<title>Reverse Thread Sorting</title>
<hookname>showthread_getinfo</hookname>
<phpcode><![CDATA[$this->validfields['forumhomeicon'] = array(TYPE_STR, REQ_NO);]]></phpcode>
</plugin>
</plugins>

if($threadid == '35') $postorder = 'ASC';

And then do I have call the hook in another file or will it work as an option automatically?

Thank you

Lynne 12-30-2009 02:17 PM

Why are you doing it in xml? Just go to Plugins & Products and select Add New Plugin and add it there. If you later want to export it, you export it from the Download /Upload Plugins page.

bluestartech 12-30-2009 03:01 PM

ohh ok. Thank you Lynne.

Now that I have it as a plugin, how do I use it on that thread? or should thread 35 automatically reverse the sort order? I dont see any new menu options or the order being reversed.

Lynne 12-30-2009 04:11 PM

You don't get any 'options' because you didn't add any. You may have to use $thread['threadid'] or $threadinfo['threadid'] instead of $threadid.

bluestartech 12-30-2009 04:25 PM

I have tried the following and none worked.

if($threadid == '35') $postorder = 'ASC';

if($thread['35']) $postorder = 'ASC';

if($threadinfo['35']) $postorder = 'ASC';

Lynne 12-30-2009 04:29 PM

That's not what I said to do. I said put in $thread['threadid'] or $threadinfo['threadid'] instead of $threadid. Exactly. I didn't say change 'threadid' to the actual threadid.

bluestartech 12-30-2009 04:38 PM

Well thank you for pointing that out. I do not want all threads to be changed, just the specific one.


All times are GMT. The time now is 07:33 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.00964 seconds
  • Memory Usage 1,727KB
  • 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
  • (1)bbcode_php_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