The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
![]()
I hope the title's descriptive enough...
![]() Basically, I'm writing a plugin that hooks into the postbit_display_complete function, where I'm bringing in a user-defined profile field ("field5") that has, for its content, a multiple selection. I know that these are bit-set (i.e. & 1, & 2 etc for the options selected) and if I post it directly into the template as an '<if condition="$post[field5] & 1">' and so on for all the relevant bit fields, it works great. Now I'm putting it into a plugin, to avoid core template changes on upgrades, and I'm trying to set the relevant variables within the plugin PHP code. The problem is, that I can't seem to get vBulletin to recognise that the $post[field5] value is a numeric... The code I'm using is this (following this is a template str_replace): Code:
$wnum = intval($this->post['field5']); if ($wnum > 0) { $add .= '<div>|$wnum|'; if ($wnum & 1) $add .= 'bit 1 set code'; if ($wnum & 2) $add .= 'bit 2 set code'; if ($wnum & 4) $add .= 'bit 4 set code'; if ($wnum & 8) $add .= 'bit 8 set code'; $add .= '</div>'; } Now, if I output the value to the template as in: Code:
$wnum = intval($this->post['field5']); $add .= '<div>Value: $wnum</div>'; it outputs the correct value. Any thoughts or am I missing something really simple? |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|