Login  Register

Re: Advertising

Posted by Pedro on Dec 20, 2012; 1:52pm
URL: https://support.nabble.com/Advertising-tp7582401p7582459.html

The code would be like this below, but I would like to see it working on a test forum before.
<override_macro name ="show_custom_ads" parameters="location" requires="servlet" >
    <n.if.equal value1="[n.location/]" value2="widget">  
        <then>  
            <div class="ad">
                <script type="text/javascript"><!--
                    google_ad_client = "ca-pub-XXXXXXXXX";
                    /* Small-Square */
                    google_ad_slot = "XXXXXXX";
                    google_ad_width = 200;
                    google_ad_height = 200;
                    //-->
                </script>
                <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
                </script> 
            </div>
        </then>  
        <else>  
            <n.if.regex_matches text="[n.location/]" pattern="(first_classic_message|last_classic_message)">  
                <then>  
                </then>  
                <else>
					<n.if.equal value1="[n.random max='10'/]" value2="1">    
						<then>
							<img alt='' src='his_ad.gif' />
						</then>    
						<else>
							<div class="ad shaded-bg-color rounded" style="padding:.5em 0">
								<script type="text/javascript"><!--
									google_ad_client = "ca-pub-XXXXXXXXXXXX";
									/* Leaderboard */
									google_ad_slot = "XXXXXXXXXX";
									google_ad_width = 728;
									google_ad_height = 90;
									//-->
								</script>
								<script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
								</script>
							</div>
						</else>    
					</n.if.equal>    				

                </else>  
            </n.if.regex_matches>             
        </else>  
    </n.if.equal> 
</override_macro> 
My test forum.