View Single Post
  #5  
Old 02-21-2011, 05:24 PM
El Queso El Queso is offline
 
Join Date: Oct 2010
Posts: 5
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You hit on a good question - "What if they're sorted by thread rating or some other factor? Where is that taken into account?"

I've been making a lot of admin moderation additions for a friend of mine who bemoans the complete lack of moderation "extras" in vBulletin. The problem there is that there are no templates to be used and I have found myself making changes to the code itself in almost all instances, when related specifically to admincp stuff.

With the user experience (in this case, specifically SHOWTHREAD.PHP) you have a bit more options because you can modify templates and put code in plugins. But you will still have situations (like this, it appears) that will cause you a problem. If vBulletin has not left you a hook and also variables to modify via the hook, then you really have no choice but to modify the PHP code itself.

In this case, as far as I'm aware vBulletin does not have any ability to set what the thread sort order field itself is - only which direction by date you can change. In the user profile you can only change the thread order, you can't set what field you want to sort on, or what calculation, etc.

In fact, as far as changing the sort order goes, you may actually be able to hook in and change variables befre the query is run. I saw this when I went back in to look and answer some of your questions. Look for "vBulletinHook::fetch_hook" to find what hook plugin events the PHP code is processing. There are various hooks for various operations within SHOWTHREAD.PHP. I know this doesn't help you much, I just metnion it in case someone else is reading to augment the information I previously posted.

But the sort order of "dateline" (yeah, it's the UNIX date/time of the post) seems to be the only field on which vBulletin, out of the box, allows us to change the sort order of the thread display query.

The only way I see for you to do this would be to change the query itself by adding a variable of your own, with your own logic to determine the sort order. It's not easy, not for the squeamish (or uncertain).

Remember that when you upgrade, there is a chance that vBulletin will have made modifications to whatever files you have changed, and therefore overwrite any changes you've made when you upgrade to a later version. If you DO make any changes, make sure you comment them in your code so you can go back and make the changes again in new versions.

BTW - I don't know if you've seen these links:

https://vborg.vbsupport.ru/showthrea...t=%24vbulletin
https://vborg.vbsupport.ru/showthrea...oduct+template

I have a hard time finding good information on really technical issues, but those two threads are valuable and not all that easy to find either. They will help you with understanding how some of the "guts" of vBulletin works.

I'm by trade a .Net developer. I found it (and still do in many ways) extremely difficult to get into the whole mindset of procedural programming and a lack of good object-oriented programming. However, the more I learn the easier it becomes to do stuff. I need to go back and remember the days of ASP programming and then it's just a matter of syntax and particulars of vBulletin's API and templates.

I don't know what your background is, but if it's a developer in another language than PHP, the hardest part of this is not only learning PHP, but tying in what vBulletin's API (through the objects it does use, like the data managers, the $vbulletin object, etc) does, their use of templates to easily modify user interface, and so on.

If you're not a developer to begin with, however, I have to say that I would not recommend modifying the PHP files to any great extent, and of course always make sure you have a backup of the original so you can things back to the way they were.
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01101 seconds
  • Memory Usage 1,775KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (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_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • showpost_complete