Go Back   vb.org Archive > Community Discussions > Modification Requests/Questions (Unpaid)
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-29-2009, 03:24 PM
bluestartech bluestartech is offline
 
Join Date: Dec 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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?
Reply With Quote
  #2  
Old 12-29-2009, 07:06 PM
we_are_borg we_are_borg is offline
 
Join Date: Jul 2004
Posts: 108
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Would be nice if you say what version you use vb3.x and vb4 are very different.
Reply With Quote
  #3  
Old 12-29-2009, 07:54 PM
vbenhancer's Avatar
vbenhancer vbenhancer is offline
 
Join Date: Dec 2009
Location: Qu?bec city, Canada
Posts: 740
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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...
Reply With Quote
  #4  
Old 12-30-2009, 02:06 PM
bluestartech bluestartech is offline
 
Join Date: Dec 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #5  
Old 12-30-2009, 02:17 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #6  
Old 12-30-2009, 03:01 PM
bluestartech bluestartech is offline
 
Join Date: Dec 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #7  
Old 12-30-2009, 04:11 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #8  
Old 12-30-2009, 04:25 PM
bluestartech bluestartech is offline
 
Join Date: Dec 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have tried the following and none worked.

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

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

if($threadinfo['35']) $postorder = 'ASC';
Reply With Quote
  #9  
Old 12-30-2009, 04:29 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #10  
Old 12-30-2009, 04:38 PM
bluestartech bluestartech is offline
 
Join Date: Dec 2009
Posts: 9
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.04105 seconds
  • Memory Usage 2,253KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)bbcode_php
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete