1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Preventing Ads on a Per Thread Basis

Discussion in 'XenForo Questions and Support' started by akia, Dec 21, 2014.

  1. akia

    akia Well-Known Member

    I'm about to implement adsense again on my site, but there are a few odd threads they may be against the TOS of adsense, well not really but I know how google can be so sensitive about it so would rather play it safe,

    My idea is to wrap the ad tags in this statement

    <xen:if is="!in_array({$thread.thread_id}, array(x, y, z))">
    This content will show in threads x, y, and z
    that way I can filter individual threads that I think are a bit gray.

    Firstly is this going to cause problems performance wise? and also is there a way to maintain a center list of the thread numbers then I can just update them the once so all the different places I'd place the ad code.
  2. Brogan

    Brogan XenForo Moderator Staff Member

    It shouldn't cause any performance issues.

    Create a custom template and add the xen:if to it.
    Then include the template in the ad templates.
    akia likes this.
  3. akia

    akia Well-Known Member

    Thanks @Brogan I knew you'd have a answer. :)

Share This Page