• 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

thumped

Well-known member
#1
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.)
 

Mike

XenForo developer
Staff member
#2
$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

Well-known member
#3
$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?
ok so i should be reading this:

When working with the PAGE_CONTAINER template, you can pass variables from the view templates (category_view, forum_view, thread_view, etc.) using xen:container. The same applies to any templates which are included in thePAGE_CONTAINER template; the header or ad_header templates for example.
To use the $forum.node_id variable for example, you would add this to the PAGE_CONTAINER template: <xen:container var="$forumId">{$forum.node_id}</xen:container>.
Similarly for the $threadId variable, you would add this: <xen:container var="$threadId">{$thread.thread_id}</xen:container>.
as "Similarly for the $threadId variable, you would add this: <xen:container var="$threadId">{$thread.thread_id}</xen:container> to thread_view"?