Template Conditional

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Papa Bear
    New Member
    • Apr 2011
    • 22
    • 5.3.x

    Template Conditional

    Is there a template conditional in VB5 that will allow me to show some text in a post if a member is in usergroup X only..
  • vb_nils
    Member
    • Jul 2012
    • 59
    • 4.2.X

    #2
    I would also be interested for this.

    Indeed the next sentence doesn't seem to work

    Code:
    <vb:if condition="$userInfo['usergroupid'] == 6">
    Any idea?

    Comment

    • Wayne Luke
      vBulletin Technical Support Lead
      • Aug 2000
      • 74154

      #3
      Originally posted by Papa Bear
      Is there a template conditional in VB5 that will allow me to show some text in a post if a member is in usergroup X only..

      The member that wrote the post or the one viewing the post? Two different things.
      Translations provided by Google.

      Wayne Luke
      The Rabid Badger - a vBulletin Cloud demonstration site.
      vBulletin 5 API

      Comment

      • vb_nils
        Member
        • Jul 2012
        • 59
        • 4.2.X

        #4
        The member that is viewing the post.
        But after many many tries and page investigation, I think I found it.
        Perhaps can you confirm?
        Code:
        <vb:if condition="$user['usergroupid'] == XX">
        But can also be interesting to have the member that wrote the post ;-)

        Can you also confirm that in $user['xxx'], the xxx can be replaced by any field of the table "user"?

        Thanks

        Comment

        • Zachery
          Former vBulletin Support
          • Jul 2002
          • 59097

          #5
          use is_member_of($VAR, VALUE); instead, it checks additional and primary usergroups.

          Comment

          • Wayne Luke
            vBulletin Technical Support Lead
            • Aug 2000
            • 74154

            #6
            Originally posted by vb_nils
            Can you also confirm that in $user['xxx'], the xxx can be replaced by any field of the table "user"?
            I would guess the total contents of the array would on the location it is used at. Would probably need an extension to do a var_dump of the array in the location where you're using it at.
            Translations provided by Google.

            Wayne Luke
            The Rabid Badger - a vBulletin Cloud demonstration site.
            vBulletin 5 API

            Comment

            • glennrocksvb
              Former vBulletin Developer
              • Mar 2011
              • 4021
              • 5.7.X

              #7
              Originally posted by Wayne Luke

              Would probably need an extension to do a var_dump of the array in the location where you're using it at.
              You can do:

              Code:
              {vb:debugvardump user}

              Flag Icon Postbit Insert GIPHY Impersonate User BETTER INITIALS AVATAR Better Name Card Quote Selected Text Bookmark Posts Post Footer Translate Stop Links in Posts +MORE!

              Comment

              Related Topics

              Collapse

              Working...