Announcement

Collapse
No announcement yet.

Problem with conditionals

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

  • Problem with conditionals

    I have a forum where I want to limit google ads and don't want them to show up on several of my forums. I've been trying to get the conditionals to work, but I haven't had much success.

    My conditional is as follows:
    Code:
    <if condition="!in_array($forumid, array(44,45,46,47,48,49,51,52))">
    Google Adsense code here
    </if>
    The forum id's that I want to exclude are 44,45,46,47,48,49,51,52. Anyone know what's wrong?
    Celebrity Gossip and Photos || Business Community

  • #2
    The variable used depends on what template you are putting that condition in. It could be that you need to replace $forumid with $foruminfo['forumid'] or $forum['forumid'] or $threadinfo['forumid'] or $thread['forumid'] or something else. You didn't say what template so try each of those.

    Please don't PM or VM me for support - I only help out in the threads.
    vBulletin Manual & vBulletin 4.0 Code Documentation (API)
    Want help modifying your vbulletin forum? Head on over to vbulletin.org
    If I post CSS and you don't know where it goes, throw it into the additional.css template.

    W3Schools &lt;- awesome site for html/css help

    Comment


    • #3
      When I looked at the conditionals FAQ, I thought there was only one set of conditionals. The templates I'm trying to use the conditionals in are postbit and postbit legacy.



      Originally posted by Lynne View Post
      The variable used depends on what template you are putting that condition in. It could be that you need to replace $forumid with $foruminfo['forumid'] or $forum['forumid'] or $threadinfo['forumid'] or $thread['forumid'] or something else. You didn't say what template so try each of those.
      Celebrity Gossip and Photos || Business Community

      Comment


      • #4
        Originally posted by tommeyboy View Post
        When I looked at the conditionals FAQ, I thought there was only one set of conditionals. The templates I'm trying to use the conditionals in are postbit and postbit legacy.
        The FAQ gives examples. It couldn't possibly list every conditional for every page.

        Please don't PM or VM me for support - I only help out in the threads.
        vBulletin Manual & vBulletin 4.0 Code Documentation (API)
        Want help modifying your vbulletin forum? Head on over to vbulletin.org
        If I post CSS and you don't know where it goes, throw it into the additional.css template.

        W3Schools &lt;- awesome site for html/css help

        Comment


        • #5
          In the future, how can I determine what the conditional should look like? Is there a place I can find out which conditional to use and the syntax, that will help me to narrow down the choices in the future?
          Celebrity Gossip and Photos || Business Community

          Comment


          • #6
            Trial and error is usually the best method, you can also use $GLOBALS[forumid] That should work regardless.

            Comment


            • #7
              Look at the page/template you are adding to and see what variables they are using there. That should give you a clue on what to use.

              Please don't PM or VM me for support - I only help out in the threads.
              vBulletin Manual & vBulletin 4.0 Code Documentation (API)
              Want help modifying your vbulletin forum? Head on over to vbulletin.org
              If I post CSS and you don't know where it goes, throw it into the additional.css template.

              W3Schools &lt;- awesome site for html/css help

              Comment

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