Responsive AdSense

Responsive AdSense

Why is it that even when I put my adsense code block above the h1 title in forum_view, forum_list and thread_view the ad still shows under the h1 title and the description?

How do I get the add to show up above it?
 
Hi Brogan,

I'm using your script now.
But i have a problem.
This is my code. And this one is working.
HTML:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'login', 'error_with_login', 'contact'))">
<xen:if is="{$post.position} == 0 AND !{$message.conversation_id}">
<style type="text/css">
.overtaking-top-dynamic {
width: 320px;
height: 50px;
}

@media(min-width: 484px) {
    .overtaking-top-dynamic {
    width: 468px;
    height: 60px;
    }
}
</style>

<script async src="http://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- Overtaking Top - Dynamic -->
<ins class="adsbygoogle overtaking-top-dynamic"
    style="display:inline-block"
    data-ad-client="ca-pub123456789"
    data-ad-slot="1234567890"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</xen:if>
</xen:if>
But when I add '' to the array (like this) it doesn't work anymore.
HTML:
<xen:if is="!in_array({$contentTemplate}, array('','message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'login', 'error_with_login', 'contact'))">

But i need that right? Otherwise it's against Google Adsense TOS.
 
Are you getting an error?
It works for me using this which I have just copied from one of my templates:
Code:
<xen:if is="!in_array({$contentTemplate}, array('', 'message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'xengallery_search_form_media', 'search_results', 'register_form', 'login', 'error_with_login', 'contact', 'thread_view', 'cta_overtaking_index'))">
 
Are you getting an error?
It works for me using this which I have just copied from one of my templates:
Code:
<xen:if is="!in_array({$contentTemplate}, array('', 'message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'xengallery_search_form_media', 'search_results', 'register_form', 'login', 'error_with_login', 'contact', 'thread_view', 'cta_overtaking_index'))">
No, just no ad. There is no error.
I tried this one too, same problem.
 
Newly created adsense ads doesn't display ads right away :)
Just wait for a couple of minutes.
It's created a long time ago so that's not the problem.
But from what i was reading we don't need the '' anymore in Xenforo 1.3. So until then i just keep it like it is now.
 
I still don't understand why it doesn't work for you.

I'm actually using '' and 'message_page' right now with no problems.
 
I still don't understand why it doesn't work for you.

I'm actually using '' and 'message_page' right now with no problems.
I don't know ether, but i have the same problem on both of my forums. Maybe because of another add-on...
I have to try this on my test forum with all add-ons disabled.
 
Brogan updated Responsive AdSense with a new update entry:

Full list of templates to prevent advertisements being displayed on in 1.3

There are a few new templates introduced in 1.3 which should also be restricted from having Google AdSense advertisements displayed on them.

Those are the aforementioned message_page and also register_twitter and register_google.

So the array of excluded pages should now look something like:
Code:
<xen:if is="!in_array({$contentTemplate}, array('message_page', 'error', 'search_form', 'search_form_post', 'search_form_profile_post', 'search_results', 'register_form', 'register_facebook',...

Read the rest of this update entry...
 
  • Like
Reactions: rdn
Can somebody please tell me how to put a medium rectangle ad in ad_message_body's right upper corner?
 
It has already been posted several times.

Just wrap the ad in a div, floating it right.
 
Top Bottom