MyBB Community Forums

Full Version: Adsense, only to guest, and beside 1 and 3rd posts.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Surprised no one has done this.

I need to conditionally show adsense.  Not to logged in users, only to guests, and only beside certain posts.

Ive tried this code to get it to show just beside the first post

<div class="post_body scaleimages" id="pid_{$post['pid']}">
    <if $postcounter == 1 then>
        <div style="display: inline-block;float: right;padding-left: 10px;">   
    ----myadsense
        </div>
    </if>
    {$post['message']}
</div>
<br class="clear" />

Doesn't work.  Shows beside all posts.  And i dont know the syntax to set a condition to only show adsense at all when user = guest.

Help?
try using this

<if $mybb->user['uid'] == 0 && $postcounter == 1 then>

your adsense

</if>
obvious query:
have you installed & activated template conditionals plugin ? it is required to use conditions.