Various Vbulletin Conditionals

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SaN-DeeP
    Senior Member
    • Dec 2003
    • 1352
    • 1.1.x

    Various Vbulletin Conditionals

    Hello,
    I need to know how to setup vbulletin conditionals in following cicumstances.
    I have seen codes which used array for multiple groups.

    Example of few usergroups.
    UserGroup Guest = ID 1
    UserGroup Members = ID 2
    Usergroup Moderators = ID 7
    Premium Usergroup = ID 12
    Administrator UserGroup = ID 6

    Questions.
    1. How to setup a conditional to show some information only to 1 usergroup.

    2. How to setup a conditional to show some information to multiple usergroups.

    3. How to setup a conditional to show some information only to 1 user id.

    4. How to setup a conditional to show some information to multiple user Ids.

    5. How to setup a conditional to hide information only from 1 usergroup.

    6. How to setup a conditional to hide information from multiple usergroups.

    7.How to setup a conditional to show hide information only from 1 user id.

    8. How to setup a conditional to hide information from multiple user Ids.

    9. How to show information only in forum

    10. How to show information in few forums

    11. How to hide information in 1 forum

    12. How to hide information in multiple forums.

    Now once I have the above codes, I can use the if and and clauses to make some more complex conditionals. (possibly show some example as well)

    Thanks and Regards,
    TechArena - TechArena Community - Technology News - Tools Download - Tech Video - Gamer Guide - Hardware Review
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    1)

    Code:
    <if condition="is_member_of($bbuserinfo, [color=red]X[/color])">
    2)

    Code:
    <if condition="is_member_of($bbuserinfo, [color=red]X, Y, Z[/color])">
    3)

    Code:
    <if condition="$bbuserinfo[userid] == [color=red]X[/color]">
    4)

    Code:
    <if condition="in_array($bbuserinfo[userid], array([color=red]X,Y,Z[/color]))">
    5)

    Code:
    <if condition="!is_member_of($bbuserinfo, [color=red]X[/color])">
    6)

    Code:
    <if condition="!is_member_of($bbuserinfo, [color=red]X, Y, Z[/color])">
    7)

    Code:
    <if condition="$bbuserinfo[userid] == [color=red]X[/color]">
    Code:
    <if condition="$bbuserinfo[userid] != [color=red]X[/color]">
    8)

    Code:
    <if condition="!in_array($bbuserinfo[userid], array([color=red]X,Y,Z[/color]))">
    9)

    Code:
    <if condition="$forumid == [color=red]X[/color]">
    10)

    Code:
    <if condition="in_array($forumid, array([color=red]X,Y,Z[/color]))">
    11)

    Code:
    <if condition="$forumid != [color=red]X[/color]">
    12)

    Code:
    <if condition="!in_array($forumid, array([color=red]X,Y,Z[/color]))">

    Comment

    • SaN-DeeP
      Senior Member
      • Dec 2003
      • 1352
      • 1.1.x

      #3
      Thanks Jake appreciate your quick reply
      TechArena - TechArena Community - Technology News - Tools Download - Tech Video - Gamer Guide - Hardware Review

      Comment

      • eJM
        Senior Member
        • Sep 2004
        • 916
        • 3.8.x

        #4
        I know this is an old thread, but I still refer to it regularly. Can you please explain how to combine conditionals? I have an ad in ad_navbar_below that I do not want to show on during registration, which I use <if condition="THIS_SCRIPT != 'register'"> to prevent. But now I need to include a specific forum as well. If it were only the forum, I could use <if condition="$forumid != X">, but I still need to keep the ad off the registration pages too.

        Thanks,

        Jim
        If my post was helpful to you, please take the time to register at my forum and ask a question you've always wanted to know about floors.
        www.TheFloorPro.com

        Comment

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

          #5
          Use OR....

          condition="THIS_SCRIPT != 'register' OR $forumid !=X"

          You can enclose individual conditions in parenthesis.
          Translations provided by Google.

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

          Comment

          • eJM
            Senior Member
            • Sep 2004
            • 916
            • 3.8.x

            #6
            Thanks Wayne.
            If my post was helpful to you, please take the time to register at my forum and ask a question you've always wanted to know about floors.
            www.TheFloorPro.com

            Comment

            • kh99
              Senior Member
              • Aug 2009
              • 533

              #7
              Sometimes you'd use OR, but based on what you described I think you need AND instead.

              Comment

              • eJM
                Senior Member
                • Sep 2004
                • 916
                • 3.8.x

                #8
                I'd love to see examples of combined conditionals, just to help show others how and when they are used.

                In my case, the OR statement is probably appropriate because the rule applies when the user is on the registration page OR on the forum page. It's not possible to be on both.

                Jim
                If my post was helpful to you, please take the time to register at my forum and ask a question you've always wanted to know about floors.
                www.TheFloorPro.com

                Comment

                • kh99
                  Senior Member
                  • Aug 2009
                  • 533

                  #9
                  But since your conditions are "not equal" (!=), you want the ad to show when you're not on the registration page and you're not in forum X.

                  In any case it should be easy enough to see which one works.

                  Comment

                  • eJM
                    Senior Member
                    • Sep 2004
                    • 916
                    • 3.8.x

                    #10
                    Actually, the forum owner decided to do something different, so I didn't get a chance to try it out.
                    If my post was helpful to you, please take the time to register at my forum and ask a question you've always wanted to know about floors.
                    www.TheFloorPro.com

                    Comment

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