Log in

View Full Version : Determining User Setting in Postbit?


Cryo
03-20-2009, 12:35 AM
Hello,

I tried searching but it seems this is too vague to find a good result. I'm trying to pull a viewer setting from a plugin that's changing how the viewer sees signatures. The field I'm checking is field32, and using the postbit_display_complete hook and it's not getting any data from the $vbulletin->userinfo['field32'] variable. Here's a sniplet of the code for the plugin...

if ($vbulletin->userinfo['field32'] == "Scroll Box") {

$this->post['signature'] = "<div class=\"sigbox\">". $this->post['signature'] ."</div>";

}

So, how do I get the VIEWER's settings through a plugin?

Cryo
03-21-2009, 12:29 PM
Any ideas or suggestions?

Lynne
03-21-2009, 03:48 PM
I don't think you want to use $this->post['signature']. Perhaps try $post['signature']

Cryo
03-21-2009, 10:23 PM
Well the signature part isn't the issue, it's getting the value of the person that's viewing the thread. Basically I'm writing a plugin that allows you to display a signature 3 different ways - in a scroll box, in a click box or just as the full signature based on a setting in your user profile. The problem that I'm having is that I apparently can't pull the thread viewer's settings via the $vbulletin->userinfo variable in the postbit_display_complete / start hooks.

I also tried adding a plugin hooked to global_complete / global_setup_complete that set a variable with the contents I needed since I could view $vbulletin->userinfo data on that plugin, but I can't seem to access that information including the hook I need either.

Lynne
03-22-2009, 12:08 AM
Try $this->registry->userinfo['field32']

Cryo
03-22-2009, 11:48 AM
Lynne, you are amazing - it worked! Thanks so much. :D