PDA

View Full Version : Anyway to get the poster's username in the threadbit_display hook?


BirdOPrey5
07-06-2010, 02:15 AM
$post[username] doesn't work. :confused:

mahz
07-08-2010, 05:18 AM
try $this->registry->post[username]

BirdOPrey5
07-08-2010, 04:24 PM
try $this->registry->post[username]

That actually caused a fatal error when trying to view the forum. :(

Also I wasn't using $post[username] but $vbulletin->post[username] that wasn't working.

Boofo
07-08-2010, 04:27 PM
Have you tried $threadinfo[username]?

BirdOPrey5
07-08-2010, 04:30 PM
Just did, it also comes up blank/isn't available.

Boofo
07-08-2010, 04:53 PM
$vbulletin->userinfo[username]

BirdOPrey5
07-08-2010, 07:05 PM
$vbulletin->userinfo[username]

The problem with that is it shows the username of the user logged in, I'm looking for the username of the thread/post creator.

Boofo
07-08-2010, 07:36 PM
The problem with that is it shows the username of the user logged in, I'm looking for the username of the thread/post creator.
Try:

$thread['postusername']

BirdOPrey5
07-08-2010, 09:51 PM
Try:

$thread['postusername']

Perfect, Thanks!

Boofo
07-08-2010, 10:23 PM
The easiest way to find out things like this is to do a text search in the files for things like "threadbit_display". Once you find what files the hook is in, it is fairly easy to see how they are calling variables.

BirdOPrey5
07-09-2010, 12:42 AM
Thanks for the tip.

abdobasha2004
07-10-2011, 12:07 AM
$thread[postusername]