complete forum conditional

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • PhilMcKrackon
    New Member
    • Apr 2008
    • 18
    • 3.8.x

    complete forum conditional

    Trying to display an image ONLY when not viewing a VBulletin page. I'm having trouble with a conditional for this.

    Any ideas?

    Example: For all VBALinks pages I use <if condition="VBA_SCRIPT != 'links_directory'">


    Is there one that can be used for VBulletin?

    Thanks,
    Last edited by PhilMcKrackon; Fri 19 Sep '08, 2:17pm.
    Jeep-CJ.com
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    For example:

    Code:
    <if condition="THIS_SCRIPT != 'index'">
    This is true for all vBulletin pages except index.php.

    Comment

    • PhilMcKrackon
      New Member
      • Apr 2008
      • 18
      • 3.8.x

      #3
      Originally posted by Jake Bunce
      For example:

      Code:
      <if condition="THIS_SCRIPT != 'index'">
      This is true for all vBulletin pages except index.php.
      Thanks for the fast reply... What I'm looking for is a conditional that is solved for all VBulletin pages including index.php.

      I need to turn off something for all forum pages but turn it back on when navigating away from the forums. Something like

      <if condition="THIS_SCRIPT != 'all_vbulletin_forum_pages'">

      Thanks again!
      Jeep-CJ.com

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        Maybe this:

        Code:
        <if condition="!THIS_SCRIPT">
        This assumes that your external pages don't have THIS_SCRIPT defined.

        Comment

        • Floris
          Senior Member
          • Dec 2001
          • 37767

          #5
          global.php from vB has:

          // identify where we are
          define('VB_AREA', 'Forum');

          You can therefor try:

          <if condition="VB_AREA != "Forum">this is not in a page where VB_AREA is defined as Forum, for example, in the blog</if>

          Comment

          • PhilMcKrackon
            New Member
            • Apr 2008
            • 18
            • 3.8.x

            #6
            Unfortunately that's my problem, many of them do. I can set up a LONG...... conditional using AND but was hoping there was an all encompassing variable like VBgallery uses ("PP_SCRIPT == 'vBGallery'") for all pages and VBaLinks uses ("VBA_SCRIPT == 'links_directory'") for all links pages. That would make life quite a bit easier.
            Jeep-CJ.com

            Comment

            • Floris
              Senior Member
              • Dec 2001
              • 37767

              #7
              Tell those authors to code properly, so it's properly integrated with vBulletin, defining VB_AREA for their section on a vb forum.

              Comment

              • PhilMcKrackon
                New Member
                • Apr 2008
                • 18
                • 3.8.x

                #8
                Originally posted by Floris
                global.php from vB has:

                // identify where we are
                define('VB_AREA', 'Forum');

                You can therefor try:

                <if condition="VB_AREA != "Forum">this is not in a page where VB_AREA is defined as Forum, for example, in the blog</if>
                Well that's better but since it's global it still solves in many of the external pages - example VB_AREA is = to 'forum' even when viewing VBa pages.

                I'm sure with some creative conditionals I can get where I need to go. It's just not going to be easy...
                Jeep-CJ.com

                Comment

                • PhilMcKrackon
                  New Member
                  • Apr 2008
                  • 18
                  • 3.8.x

                  #9
                  Originally posted by Floris
                  Tell those authors to code properly, so it's properly integrated with vBulletin, defining VB_AREA for their section on a vb forum.
                  I agree and I'm pursuing that in just a moment... Thanks for all the help. Gives me a great start!

                  Thanks,
                  Jeep-CJ.com

                  Comment

                  • Floris
                    Senior Member
                    • Dec 2001
                    • 37767

                    #10
                    Or use a plugin that does it all for you
                    so your template only has to have a variable or something.

                    [find out where i am]
                    [so if the result from this is true, set $iamhere = forum, else set $iamhere = notforum]

                    Then in your template <if condition="$iamhere != "notforum"">yay</if>

                    Comment

                    • PhilMcKrackon
                      New Member
                      • Apr 2008
                      • 18
                      • 3.8.x

                      #11
                      Originally posted by Floris
                      Or use a plugin that does it all for you
                      so your template only has to have a variable or something.

                      [find out where i am]
                      [so if the result from this is true, set $iamhere = forum, else set $iamhere = notforum]

                      Then in your template <if condition="$iamhere != "notforum"">yay</if>
                      Perfect! Sometimes the obvious is the most difficult to see...
                      Jeep-CJ.com

                      Comment

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