MyBB Community Forums
[How To?] add google adsense in first post - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: 1.8 Support (https://community.mybb.com/forum-175.html)
+--- Forum: General Support (https://community.mybb.com/forum-176.html)
+--- Thread: [How To?] add google adsense in first post (/thread-163773.html)

Pages: 1 2


add google adsense in first post - [email protected] - 2014-12-05

How we can add google adsense only to 1st post of thread ? through code or any plugin available ?
thanks


RE: add google adsense in first post - [email protected] - 2014-12-11

(2014-12-05, 07:00 PM)[email protected] Wrote: How we can add google adsense only to 1st post of thread ? through code or any plugin available ?
thanks
dear all, still waiting for any help, suggestions 


RE: add google adsense in first post - Destroy666 - 2014-12-12

Download Template Conditionals: http://mybbhacks.zingaburga.com/showthread.php?tid=464 and activate it.

Then add this code to postbit/postbit_classic templates:
<if $postcounter == 1 then>
...ad HTML here...
</if>



RE: add google adsense in first post - [email protected] - 2014-12-12

thanks it worked.
how we can align right within the first post ?


RE: add google adsense in first post - [email protected] - 2014-12-13

how we can align right within the first post ?


RE: add google adsense in first post - SvePu - 2014-12-13

You have to add the adsense div container right above {$post['message']} and also add some inline style into that adsense div.

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



RE: add google adsense in first post - [email protected] - 2014-12-18

After following your provided code, google ad is coming on right but 

my all replies of posts are not showing ??


RE: add google adsense in first post - SvePu - 2014-12-18

It works for me but you could try it without <br class="clear" />.

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

   


RE: add google adsense in first post - rkrusty - 2014-12-31

tried condtion above but problem is ad is behind the text.  Sad


RE: add google adsense in first post - SvePu - 2014-12-31

The problem is a css styling of your add script.

Try a change in theme global.css from:
.separator {
margin: 5px;
padding: 0;
height: 0px;
font-size: 1px;
list-style-type: none;
}

to:
.separator {
margin: 5px;
padding: 0;
height: auto;
font-size: 1px;
list-style-type: none;
}