![]() |
(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 |
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.
|
Definitely need to put your brackets back in for the OR part just like in the original.
|
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. |
my bad... :confused:
|
We all have to learn nuances. I've made worse mistakes.
In the if condition AND would be && using ampersands instead of text. |
All times are GMT. The time now is 05:56 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|