PDA

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


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

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

BirdOPrey5
07-08-2010, 03: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, 03:27 PM
Have you tried $threadinfo[username]?

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

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

BirdOPrey5
07-08-2010, 06: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, 06: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, 08:51 PM
Try:

$thread['postusername']

Perfect, Thanks!

Boofo
07-08-2010, 09: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-08-2010, 11:42 PM
Thanks for the tip.

abdobasha2004
07-09-2011, 11:07 PM
$thread[postusername]