usergroup conditional

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • loaf
    Senior Member
    • Jun 2007
    • 303
    • 3.6.x

    usergroup conditional

    I must be doing something wrong...

    I want real names to show up in the postbit but only for certain usergroups. So I put the following into the postbit_legacy template:

    Code:
             <if condition="in_array($bbuserinfo['usergroup'], array(6,15))">
                  <div>
                      <if condition="$post['field5']">
                          a.k.a. : $post[field5]
                      </if>
                  </div>
             </if>
    I only want the info to show for members of usergroups 6 and 15. So what am I doing wrong?
  • DelphiVillage
    Senior Member
    • Apr 2002
    • 1051
    • 4.1.x

    #2
    Originally posted by loaf
    I must be doing something wrong...

    I want real names to show up in the postbit but only for certain usergroups. So I put the following into the postbit_legacy template:

    Code:
             <if condition="in_array($bbuserinfo['usergroup'], array(6,15))">
    try changing the first line

    Code:
    <if condition="in_array($bbuserinfo[usergroupid],array(6,15))">
    also you could use

    Code:
    <if condition="is_member_of($bbuserinfo,array(6,15))">

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      You want it to showup for the person viewing the post? or the poster? Furthermore what template are you doing this in?

      Comment

      • loaf
        Senior Member
        • Jun 2007
        • 303
        • 3.6.x

        #4
        I want it to show up for the person viewing the post. And I'm doing it in the postbit_legacy template.

        Comment

        • Zachery
          Former vBulletin Support
          • Jul 2002
          • 59097

          #5
          Use is_member_of($bbuserinfo, 1,2,3)

          Comment

          • loaf
            Senior Member
            • Jun 2007
            • 303
            • 3.6.x

            #6
            Thanks! What's the difference between Use is_member_of($bbuserinfo, 1,2,3) and having the word array in there?

            Comment

            • Zachery
              Former vBulletin Support
              • Jul 2002
              • 59097

              #7
              It already is looking for an array.

              Comment

              widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
              Working...