XF 2.1 Script in header, but not in Node IDs X,Y and Thread IDs Z,A,B

TLDR

Active member
Hello,

I want to put a script into my header. Simple enough with editing PAGE_CONTAINER.

This script actually is this fancy new auto-populating adsense. But to comply with Adsense rules, it has to be hidden in certain circumstances. Such as when the topic is too hot for Google's likings. Whatever. I have a long list of thread IDs which need to be excluded.

So now I found this thread:
and this thread:

And neither of them work. :(

I know in XF1, I had to make the thread id available globally in order to query it in PAGE_CONTAINER. This is what the first thread seems to solve. But it doesn't work for me.

So here's my code so far:
PAGE_CONTAINER:
Code:
<xf:if is="!in_array($forum.node_id|raw, [43,47,37,33]) AND !in_array($__globals.threadID|raw, [40110,43159,25379,27864,17238,42944,31877,6694,34877,1248,35438,41077,32959,29254,8696,34937,34064,39041,2581,2352,42487,797,5622,12413,20728,27721,391,34598,38501,1347,156,37156,43408,31016,34811,9335,3884,42486,23324,666,38984,35237,37817,8149,42893,43559,41504,2187,37347,4485,40153,16631,43557,43559,9736,33469,43559,43515,43559])">
    ADSENSE
<xf:else />
    NO ADSENSE
</xf:if>

thread_view:
Code:
<xf:page option="threadID">{$thread.thread_id}</xf:page>

xf:set doesn't work and the tag that did the trick in XF 1, xf:container, doesn't exist any more.

The node blacklist seems to work tho. Just the thread blacklist that doesn't.

Thank you!
 
Back
Top Bottom