The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Variable for Username of the Person who posted the item.
Im not sure if the title is suited for i what i need but here goes.
This Variable Returns the name of the logged in user Code:
$vbulletin->userinfo['username'] I hope someone understands me lol Thanks in advance. |
#2
|
|||
|
|||
It should be in $post['username'].
|
#3
|
|||
|
|||
returns null?
its in a vb plugin i should add. --------------- Added [DATE]1348250142[/DATE] at [TIME]1348250142[/TIME] --------------- I also tried for giggles Code:
$vbulletin->post['username'] I need to equivalent version of Code:
$post['username'] Code:
$vbulletin->post['username'] |
#4
|
|||
|
|||
There is no list of field in $vbulletin. If you really wanted to see what's there you could use print_r($vbulletin). But I don't think you'll find any "current post" fields in there.
What hook is your plugin using? |
#5
|
|||
|
|||
Hook Location: Global_Start Plugin code This works well but shows my avatar instead of the avatar thats assigned to the posters username. The red has to be be the var that looks for the username of the postbit its being displayed in.
|
#6
|
|||
|
|||
OK, the problem is that global_start is only called once. To display something in postbit_legacy for each poster you need to use a hook that's called once for each post, like postbit_display_complete.
For efficiency, you might want to create a global variable as a cache, so that if the same user has posted more than once on the page, you only have to do the work once. (But it might be a good idea to get it working before optimizing). |
#7
|
|||
|
|||
i also tried threadbit_display &
Code:
$thread['postusername'] Code:
postbit_display_complete + $thread['postusername'] |
#8
|
|||
|
|||
Ok so heres an update.... the above code displays the username of the person who started the thread. KH99 you were correct with the right hook it works. I was using global_start instead of postbit_display_complete with the $post var.
Code:
postbit_display_complete + $post['username'] |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|