vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   <!--#--> ordering (https://vborg.vbsupport.ru/showthread.php?t=286980)

AllanZ 08-23-2012 02:15 PM

<!--#--> ordering
 
Is it possible to use <!--#--> to order sticky threads? I know it is with usergroups, just wondering what I would have to do to get that to work with forum titles so I can order my sticky threads.

Eosian 08-23-2012 02:42 PM

No, sorting of threads is handled by whatever defaults are set on a per forum basis, or by whatever sort options are passed in the event the user uses the forum sorting tool bar.

If you add a field named stickysortorder to the threads table, default it 0 (or 99, depending on your native sort direction) and add a plugin to the forumdisplay_query hook to set the following variables;

$sqlsortfield
$sqlsortorder
$sqlsortfield2

Into approximately;

$sqlsortfield2 = $sqlsortfield;
$sqlsortfield = " stickysortorder ";

You could jury rig it and manually set the stickysortorder on your threads to what you want. The biggest flaw in this, aside from the potential for something else to already be using both sort variables, is that unless you change forumdisplay.php physically both sort fields use the same sortorder. Your default value needs to be higher/lower than your intended "used" sort order and correspond directly to your default sort direction, so it takes some tweaking.

There isn't any hook between forumdisplay_query and the actual processing of it's array that you can use to rearrange the sort order, which is determined by that query, is hard coded to do stickies first, then whatever the sort order requested was.

Alternative Sorting is not something vBulletin is very flexible on, most of the things you'd like to sort are hardcoded and offer no hooks to override.


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