The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#3
|
|||
|
|||
![]()
I probably should have returned and posted my solution for other's reference.
The problem I found with trying to set a variable was I didn't (and still don't) completely understand how the user data is being generated when the user is a guest. The code that determines the sort order is in SHOWTHREAD.PHP. The value it uses is the guest user's "postorder" variable ($vbulletin->userinfo['postorder']). The standard guest user name in the version that comes out of the box is "Unregistered". I don't have a user with the user name "Unregistered" so obviously vBulletin is doing something on authentication to create that user and its information. I don't know if there's something else in the admin portions of vBulletin that allows one to set the "Unregistered" user's default info or not, but I couldn't find it if there is. Doing this from a hook seems to be problematic. You have to be able to set the $vbulletin->userinfo['postorder'] to '' (empty string) to make it work (see the code below for how it generates the sort order for the query), but when I tried to do this in a plug-in, using the 'showthread_start' hook, I got no changes in my sort order. Maybe this property unassignable, or the user (or its information) gets recreated every postback because it's not a database user? I don't know. What I did to solve the problem was to hack the SHOWTHREAD.PHP file thusly: Find this code ("set post order" should find it directly): PHP Code:
PHP Code:
As far as going further with highest rated threads sorting and/or promoting threads - you can see where to make the changes to the sort order itself, but it will be a bit more complex than I laid out than for just a user that's not logged in. You will obviously have to get the other info you are interested in and make the conditional fit your needs. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|