The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
Registring a variable.
Hello:
I'm trying to register a variable. It will need to check whenever a visitor belong to the poster buddy list, so... PHP Code:
Now, I think I will do something like this: Code:
<vb:if condition="in_array($post[userid], $new_buddylist)"> $post[email] </vb:if> Thanks. |
#2
|
|||
|
|||
The code you posted is both rendering the postbit_legacy template and preRegistering your variable to it. You don't need to do both. I think you probably just need the preRegister part, like:
Code:
$new_buddylist = explode(' ', $bbuserinfo['buddylist']); $templatevalues['my_buddylist'] = $new_buddylist; vB_Template::preRegister('postbit_legacy', $templatevalues); Then you'd use $my_buddylist in template postbit_legacy. |
#3
|
|||
|
|||
Thanks kh99. Then, I do:
Code:
<vb:if condition="in_array($post[userid], $my_buddylist)"> $post[email] asd </vb:if> PHP Code:
$new_buddylist is: array(1) { [0]=> string(0) "" } Why? |
#4
|
|||
|
|||
Did you check $bbuserinfo['buddylist']? To be honest I can't remember if you can use $bbuserinfo in a plugin, you might have to use $vbulletin->userinfo instead.
|
#5
|
|||
|
|||
Of course, that was the problem. Thanks a lot, it works.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|