The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Probably a simple problem but... I need help.
I have a product which forms a variable in a plugin using the postbit_display_start hook:
PHP Code:
This works completely fine and it echos and works properly. However, when it comes to viewing a private message, it screws up. For some reason, when postbit_display_start executes, it ends up using the user id of the person VIEWING the PM, not of the person who the PM is from... What I need is to basically have a string (for both viewing posts/threads AND for viewing PMs) which has the poster's/sender's user ID in it. |
#2
|
||||
|
||||
Can't you just put this in the template itself?
Code:
whatever$post[userid] |
#3
|
|||
|
|||
No because I'm using the userid to create an image path in the plugin.
For example: PHP Code:
|
#4
|
|||
|
|||
I'm not sure why that would occur. Does
PHP Code:
PHP Code:
|
#5
|
|||
|
|||
PHP Code:
PHP Code:
I suppose if there's a way to determine whether a PM or Post is being viewed in the plugin, I could assign the proper variable. BUT still: why is vBulletin using MY userid for $post['userid'] in the plugin and only for PMs? It doesn't really make any sense. |
#6
|
|||
|
|||
This is still an issue... can anyone help?
|
#7
|
|||
|
|||
$post['fromuserid'] would not be set in a thread so use a conditional checking if a value is set for $post['fromuserid'] and use that id if it is and an else clause using the other if it is not set
|
#8
|
|||
|
|||
I really doubt vBulletin would load your UserID into the $post['userid'], are you sure you not viewing a PM you sent to yourself or something? (Look at the variable vBulletin uses when it links your username to the profile. It uses $post['userid'], maybe if you tried moving the hook to postbit_display_complete and used $this->post['userid'] ?).
If it still doesn't work post the full code you are using. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|