Announcement

Collapse
No announcement yet.

Various Vbulletin Conditionals

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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 - News - Download - Video - Guide - Review

  • #2
    1)

    Code:
    <if condition="is_member_of($bbuserinfo, X)">
    2)

    Code:
    <if condition="is_member_of($bbuserinfo, X, Y, Z)">
    3)

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

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

    Code:
    <if condition="!is_member_of($bbuserinfo, X)">
    6)

    Code:
    <if condition="!is_member_of($bbuserinfo, X, Y, Z)">
    7)

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

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

    Code:
    <if condition="$forumid == X">
    10)

    Code:
    <if condition="in_array($forumid, array(X,Y,Z))">
    11)

    Code:
    <if condition="$forumid != X">
    12)

    Code:
    <if condition="!in_array($forumid, array(X,Y,Z))">

    Comment


    • #3
      Thanks Jake appreciate your quick reply
      TechArena - TechArena Community - News - Download - Video - Guide - Review

      Comment


      • #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


        • #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 - Full / Mobile
          Vote for your favorite feature requests and the bugs you want to see fixed.

          Comment


          • #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


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

              Comment


              • #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


                • #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


                  • #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...
                    X