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

XF 1.4 Adsense Text Wrap

Discussion in 'Styling and Customization Questions' started by cdub, Nov 22, 2014.

  1. cdub

    cdub Well-Known Member

    I'm pulling my hair out now. Why won't the text wrap?

    I'm trying to put an adsense ad in my message text. I'm posting the following after this line of text in the ad_message_body template:

    Code:
    <xen:comment> PLACE YOUR ADVERTISEMENT CODE DIRECTLY BELOW </xen:comment>
    
    Here's what I'm posting:

    Code:
    <xen:if is="!{xen:helper ismemberof, $visitor, 11}">
        <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    
    <div style="margin: 2px; float: left;">
           
    adsense code
    
    </div>
    
    </xen:if>
    
    </xen:if>
    
    
    and it still looks like this:

    Screenshot 2014-11-21 at 10.40.40 PM.png
     
  2. Walter

    Walter Well-Known Member

    Remove the space between "float:" and "left"
     
  3. cdub

    cdub Well-Known Member

    Nope. :( Still not wrapping.
     
  4. cdub

    cdub Well-Known Member

    The full code of ad_message body is this:

    Code:
    
    <xen:if hascontent="true">
       
        <div class="funbox">
        <div class="funboxWrapper">
        <xen:contentcheck>
       
            <xen:if hascontent="true">
                <xen:contentcheck>
                    <xen:hook name="ad_message_body" />
                   
                   
                    <xen:comment> PLACE YOUR ADVERTISEMENT CODE DIRECTLY BELOW </xen:comment>
    
    
    <xen:if is="!{xen:helper ismemberof, $visitor, 11}">
        <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    
    <div style="margin:2px; float:left;">
           
    ADSENSE CODE
    
    </div>
    
    </xen:if>
    
    </xen:if>
    
                </xen:contentcheck>
            <xen:elseif is="{$visitor.is_admin} && @uix_previewAdPositions" />
                <div>{xen:phrase 'template'}: ad_message_body</div>
            </xen:if>
       
        </xen:contentcheck>
        </div>
        </div>
       
    </xen:if>
    
    
     
  5. Walter

    Walter Well-Known Member

    I have nearly the same in my template and it works. What template are you modifying???

    You should only modify the template "ad_message_body" - and this templare by default only contains this:
    HTML:
    <xen:hook name="ad_message_body" />
    Nothing more.
     
  6. cdub

    cdub Well-Known Member

    That's how the template looks with UI.X Dark maybe?.... I'll change it to how you said.
     
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Can you make the ads visible to guests so I can check?

    I do exactly the same on my site and it works fine.
     
  8. cdub

    cdub Well-Known Member

    That worked! :)
     
  9. cdub

    cdub Well-Known Member

    I got it to work once I removed all the stuff that I think UI.X dark added to the template.
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    Yes, it looks fine now.
     
  11. cdub

    cdub Well-Known Member

    And now I just have to see if adsense performs better at all with it set up like this.
     
  12. cdub

    cdub Well-Known Member

    I'm trying this out again on my site to see how it goes. Results were inconclusive before. I'm showing in the first post of each page in the ""ad_message_body"' and only to guests.

    Code:
    <xen:hook name="ad_message_body" />
    
    <xen:if is="!{$visitor.user_id}">
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    
    
    <div style="margin: 15px; float: left;">
    
    ADSENSE CODE HERE
    
    </div>
    
    
    
    </xen:if>
    
    </xen:if>
    
    
    
    You can see it action on this site:

    http://www.filmschool.org/
     
  13. cdub

    cdub Well-Known Member

    Still seeing how it goes... but I'm playing around with the "register and login" to remove in post add link:

    Code:
    
    <xen:hook name="ad_message_body" />
    
    <xen:if is="!{$visitor.user_id}">
    <xen:if is="{$post.position} % {$xenOptions.messagesPerPage} == 0 AND !{$message.conversation_id}">
    
    
    <div style="margin: 15px; float: left;">
    
    ADSENSE CODE
    
    <br><center><font size="1"><a href="http://www.filmschool.org/login/"  class="inner OverlayTrigger">Register and login to remove this "in post" ad.</a></font>
    </center></div>
    
    
    
    </xen:if>
    
    </xen:if>
    
    
    
     

Share This Page