Conditionals for navbar template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • skeen
    Senior Member
    • Sep 2004
    • 112
    • 3.6.x

    Conditionals for navbar template

    I need to display some links in the navbar only if the user is not unregistered/banned/awaiting confirmation -- so, on the condition that theyre not in some particular usergroups.

    What conditional do I use?
  • skeen
    Senior Member
    • Sep 2004
    • 112
    • 3.6.x

    #2
    Is it possible to do this?

    Comment

    • Zachery
      Former vBulletin Support
      • Jul 2002
      • 59097

      #3
      Yes

      <if condition="is_member_of($bbuserinfo, x)">

      Replace X with the prper usergroupid

      Comment

      • skeen
        Senior Member
        • Sep 2004
        • 112
        • 3.6.x

        #4
        Thanks Zach. How do I enter multiple usergroup IDs?

        Comment

        • Zachery
          Former vBulletin Support
          • Jul 2002
          • 59097

          #5
          <if condition="is_member_of($bbuserinfo, x,y,z,a,b,c"> should work in 3.5

          Comment

          • TheMusicMan
            Senior Member
            • Oct 2002
            • 2140
            • 3.7.x

            #6
            Like this...

            <if condition="is_member_of($bbuserinfo, x)" OR "is_member_of($bbuserinfo, y)" OR "is_member_of($bbuserinfo, z)">
            Code to show if x or y or z
            </if>
            John

            Comment

            • zendiver
              Member
              • Sep 2004
              • 73
              • 3.5.x

              #7
              Originally posted by TheMusicMan
              Like this...

              <if condition="is_member_of($bbuserinfo, x)" OR "is_member_of($bbuserinfo, y)" OR "is_member_of($bbuserinfo, z)">
              Code to show if x or y or z
              </if>
              So MusicMan, you previously stated that this would work:
              Code:
              <if condition="in_array($bbuserinfo[usergroupid], array(5,6,7,9,11,12,24))">
              Will either way work in 3.5.2?
              Check out my latest Dive Videos.
              Spend your surface interval at www.zendiving.com

              Comment

              • TheMusicMan
                Senior Member
                • Oct 2002
                • 2140
                • 3.7.x

                #8
                Yes... they will both work. The array method is new to vB35 series and is the preferred method I'd use in 35. I don't know the reason for it, but as this is a new way of doing things in vB35, I guess it's the preferred way.

                Good luck.
                John

                Comment

                • Trevor Hannant
                  vBulletin Support
                  • Aug 2002
                  • 24178
                  • 5.7.X

                  #9
                  Originally posted by Zachery
                  Yes

                  <if condition="is_member_of($bbuserinfo, x)">

                  Replace X with the prper usergroupid
                  Just to clarify, just add that line immediately ahead of the link you want to restrict?
                  Vote for:

                  - Admin Settable Paid Subscription Reminder Timeframe (vB6)
                  - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

                  Comment

                  • Trevor Hannant
                    vBulletin Support
                    • Aug 2002
                    • 24178
                    • 5.7.X

                    #10
                    Originally posted by Trevster
                    Just to clarify, just add that line immediately ahead of the link you want to restrict?
                    Tested it out on a test forum and works a treat!
                    Vote for:

                    - Admin Settable Paid Subscription Reminder Timeframe (vB6)
                    - Add Admin ability to auto-subscribe users to specific channel(s) (vB6)

                    Comment

                    • DaveAK
                      New Member
                      • Dec 2005
                      • 26
                      • 3.5.x

                      #11
                      Originally posted by Zachery
                      <if condition="is_member_of($bbuserinfo, x,y,z,a,b,c"> should work in 3.5
                      Works perfect for me in 3.5.2! Thanks!

                      Comment

                      widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                      Working...
                      😀
                      😂
                      🥰
                      😘
                      🤢
                      😎
                      😞
                      😡
                      👍
                      👎