1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

xen:helper ismemberof, $user, 3 for message template

Discussion in 'XenForo Questions and Support' started by Russ, Apr 26, 2013.

  1. Russ

    Russ Well-Known Member

    Is there something that I can use that's like this inside the "message" template.

    <xen:if is="{xen:helper ismemberof, $user, 3}">content</xen:if>

    Trying to add an extra class, I'm aware of the staff css but it I need to narrow it down to a specific user group if possible. When attempting this code above, I'm getting this:



    Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be an array, null given in blah/blah/library/XenForo/Template/Helper/Core.php, line 1155
    Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be an array, null given, called in blah/blah/library/XenForo/Template/Helper/Core.php on line 1163 and defined in blah/blah/library/XenForo/Model/User.php, line 1401
    Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be an array, null given in blah/blah/library/XenForo/Template/Helper/Core.php, line 1155
    Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be an array, null given, called in blah/blah/library/XenForo/Template/Helper/Core.php on line 1163 and defined in blah/blah/library/XenForo/Model/User.php, line 1401
    Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be an array, null given in blah/blah/library/XenForo/Template/Helper/Core.php, line 1155
    Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be an array, null given, called in blah/blah/library/XenForo/Template/Helper/Core.php on line 1163 and defined in blah/blah/library/XenForo/Model/User.php, line 1401
    Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be an array, null given in blah/blah/library/XenForo/Template/Helper/Core.php, line 1155
    Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be an array, null given, called in blah/blah/library/XenForo/Template/Helper/Core.php on line 1163 and defined in blah/blah/library/XenForo/Model/User.php, line 1401
    Argument 1 passed to XenForo_Template_Helper_Core::helperIsMemberOf() must be an array, null given in blah/blah/library/XenForo/Template/Helper/Core.php, line 1155
    Argument 1 passed to XenForo_Model_User::isMemberOfUserGroup() must be an array, null given, called in blah/blah/library/XenForo/Template/Helper/Core.php on line 1163 and defined in blah/blah/library/XenForo/Model/User.php, line 1401
    xelexi/public_html/dev/library/XenForo/Template/Helper/Cor
     
  2. Chris D

    Chris D XenForo Developer Staff Member

    Replace $user with $message

    The message record should be joined to the user record for the message author, therefore will contain the data to check usergroup membership :)
     
    Jake Bunce and Russ like this.
  3. Russ

    Russ Well-Known Member

    Sweet, fixed thanks Chris.
     

Share This Page