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

XF 1.4 Problem with thread ID conditional statement

Discussion in 'Troubleshooting and Problems' started by thumped, May 25, 2015.

  1. thumped

    thumped Well-Known Member

    Resposting this from the conditional statements thread...

    For years i've been successfully preventing adsense from appearing on certain flagged threads by wrapping the adsense code in page_container_js_head using
    Code:
    <xen:if is="!in_array({$threadId}, array(43336,52702,46855,27897,84323,58726,28197,50759,81976,52186,53815,53126,59333,67655,22744))">
    I have
    Code:
    <xen:container var="$threadId">{$thread.thread_id}</xen:container>
    in page_container and everything works as expected.

    Or rather, worked as expected. Last Friday I received a warning email from Google saying ads were appearing on one of the threads (43336) and should be removed... I've no idea when the conditional actually stopped working, or what caused it.

    Meanwhile, I'm also blocking all ads for sponsors with
    Code:
    <xen:if is="!{xen:helper ismemberof, $visitor, 9}">
    in page_container_js_head, and that's still working fine

    I've tried disabling all addons via config.php but it doesn't help.

    (The problem seems to be the same as this one.)
     
  2. Mike

    Mike XenForo Developer Staff Member

    $thread isn't available in PAGE_CONTAINER, so I'm not sure when that would have worked. Are you sure you didn't mean to add that line to thread_view?
     
    thumped likes this.
  3. thumped

    thumped Well-Known Member

    ok so i should be reading this:

    as "Similarly for the $threadId variable, you would add this: <xen:container var="$threadId">{$thread.thread_id}</xen:container> to thread_view"?
     
  4. Mike

    Mike XenForo Developer Staff Member

    Correct.
     
    thumped likes this.
  5. thumped

    thumped Well-Known Member

    bingo. this means it broke when i changed styles a few weeks back.

    thanks dude.
     

Share This Page