The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
(Simple enough) Change from php code in plugin to template code
This is a conditional code in a plugin,
if(($thread['postuserid'] == $this->registry->userinfo['userid']) OR ($this->registry->userinfo['permissions']['answers_forum_perms'] & $this->registry->bf_ugp_answers_forum_perms['canselect_others_answers'])){ } i want to put it in template, is this right guys? because i think this is not fully working <if condition="$thread['postuserid'] == $this->registry->userinfo['userid'] OR $this->registry->userinfo['permissions']['answers_forum_perms'] & $this->registry->bf_ugp_answers_forum_perms['canselect_others_answers']"> </if> regrads |
#2
|
||||
|
||||
In the template conditional I would use 'AND' instead of & but either may work... I know 'AND' does and you already use 'OR' - also I would use brackets () to make the logic easier to follow.
|
#3
|
||||
|
||||
Definitely need to put your brackets back in for the OR part just like in the original.
|
#4
|
|||
|
|||
Looks fine. It should work with or without the grouping Lynne suggests. Making them explicit can be faster though.
<if condition="($thread['postuserid'] == $this->registry->userinfo['userid']) OR ($this->registry->userinfo['permissions']['answers_forum_perms'] & $this->registry->bf_ugp_answers_forum_perms['canselect_others_answers'])"> </if> Do not change the & to AND. It is a bitwise arithmetic operation. AND is a logical operator. |
#5
|
||||
|
||||
my bad...
|
#6
|
|||
|
|||
We all have to learn nuances. I've made worse mistakes.
In the if condition AND would be && using ampersands instead of text. |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|