Google Adsense tips and visual overview of ad positions

Google Adsense tips and visual overview of ad positions

Mr. Jinx

Well-known member
Has anyone turned the "After First, Middle and Before Last Post" option into "After First, Middle and After Last Post" and would care to share? I just played with it for a bit and couldn't get it to display.
Wondering why nobody replied? That's because you'll get a headache making these unreadable conditionals :p
Give this one a try:
Code:
<xf:if is="in_array($post.position % $xf.options.messagesPerPage, [0,($xf.options.messagesPerPage / 2) - 1]) OR $post.position % $xf.options.messagesPerPage + 1 == count($__globals.posts) AND count($__globals.posts)>4">
 
Is there an existing container that places ads in that section at all? I will just use that one as long as it puts ads in between the new profile posts
 

ge66

Well-known member
This can be done without an addon now. Just need to use this code:

Code:
<xf:if is="$__globals.firstUnread.post_id == $post.post_id">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>
Is there a way to make this work and not show up below the two first posts and not the two last post? Having banners there already and want to keep them as this banner only shows for logged in users.
 

ge66

Well-known member
Is there a way to make this work and not show up below the two first posts and not the two last post? Having banners there already and want to keep them as this banner only shows for logged in users.
@Mr. Jinx do you have any suggestions about the above?
 

Mr. Jinx

Well-known member
Please try this one @ge66 and let me know if it works:
Code:
<xf:if is="$__globals.firstUnread.post_id == $post.post_id AND $post.position % $xf.options.messagesPerPage > 1 AND (count($__globals.posts) - $post.position % $xf.options.messagesPerPage) > 2">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>
 

ge66

Well-known member
Please try this one @ge66 and let me know if it works:
Code:
<xf:if is="$__globals.firstUnread.post_id == $post.post_id AND $post.position % $xf.options.messagesPerPage > 1 AND (count($__globals.posts) - $post.position % $xf.options.messagesPerPage) > 2">
    <div style="margin:3px 0 3px 0;">
    ### your ad code ###
    </div>
</xf:if>
Thank you, I have done some testing and I think it is working.
 
Top