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

XF 1.3 Adsense in the first message of page

Discussion in 'XenForo Questions and Support' started by Cidrack, Apr 23, 2014.

  1. Cidrack

    Cidrack Active Member

  2. Brogan

    Brogan XenForo Moderator Staff Member

    See the AdSense tutorial in my signature.
     
    Cidrack likes this.
  3. Cidrack

    Cidrack Active Member

    I Read anytimes but I realy have dificult to understand how to work with This codes and do what I want in the first post... And more dificult with the English...

    Thank You very much.
     
  4. Brogan

    Brogan XenForo Moderator Staff Member

    Use the ad_message_body template.

    Code:
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
    AdSense code
    </xen:if>
    You will need to apply styling such as float:right, margins, etc.
     
    Cidrack likes this.
  5. Cidrack

    Cidrack Active Member

    Hi brogan.... Thank You again.... This is my code but....

    How and where I put code to apply styling to look same This page?
    http://www.drummerworld.com/forums/showthread.php?t=20547



    <xen:hook name="ad_message_body" />
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- Dentro da Mensagem -->
    <ins class="adsbygoogle"
    style="display:inline-block;width:300px;height:250px"
    data-ad-client="ca-pub-1454635887431753"
    data-ad-slot="6076968025"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push(\{\});
    </script>
    </xen:if>
     
  6. Cidrack

    Cidrack Active Member

    @Brogan my doubt now is how force this adsense to right side...

    Thanks.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    I already explained how to do that in my previous post.
     
  8. Cidrack

    Cidrack Active Member

    Sorry, I Know, but I didnt understand how and where put the Styles...

    I Think is This:

    <xen:hook name="ad_message_body" />
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0">
    <div style="float: right">
    <script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
    <!-- Dentro da Mensagem -->
    <ins class="adsbygoogle"
    style="display:inline-block;width:300px;height:250px"
    data-ad-client="ca-pub-1454635887431753"
    data-ad-slot="6076968025"></ins>
    <script>
    (adsbygoogle = window.adsbygoogle || []).push(\{\});
    </script>
    </div>
    </xen:if>
     

Share This Page