I have read the topics on Google AdSense and also have downloaded the AdSense code. It is working well. Here is the issue:
A website can display upto three Google advertisements on the webpage. The code helps me to display one ad after the first post. How can we make a website display (a) Ad after first post (b) Ad after 3rd post, if there is no post the ad will not display and (c) Ad after the last post, if there is only one post the ad will not display becasue it is already displayed as in (a).
Can you please help me? Thanks in advance.
Code from MiniBB.com forum:
function parseMessage(){
//Use $GLOBALS['anchor'] for determining the anchor value $GLOBALS['adsense']='';
if ($GLOBALS['anchor']==1 or $GLOBALS['anchor']==9){
//You Adsense generated code here $GLOBALS['adsense'] = <<<out
<script type="text/javascript"><!-- google_ad_client = "pub-XXXXXXXXXXXXXXXXX"; google_ad_width = 468; google_ad_height = 60; google_ad_format = "468x60_as"; google_ad_type = "text_image"; google_ad_channel =""; google_color_border = "E9EFF4"; google_color_bg = "E9EFF4"; google_color_link = "006699"; google_color_text = "000000"; google_color_url = "006699"; //--></script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
out;
}
return; } |