MyBB Community Forums

Full Version: adsense inside post --- Is it possible?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi All,

I would like to place my adsense referral code in one of the sticky posts. Is there any workaround to do that?

If I place it directly, it will show the javascript code but will not execute javascript.

Hope I have made my question clear.

Thanks
Hi,

The MyBB parser automatically cleans any javascript you put in your posts for security. You will need a mod/mycode for this which you can request at the Plugins forum.
yup it's possible.. use this data for new custom mycode
MyCode title: your choise
MyCode discrepstion: your choice
Regular expression:
\[ads=(.*?) w=(.*?) h=(.*?)\](.*?)\[/ads\]
Replacement:
<script type="text/javascript">google_ad_client ="pub-$4";google_ad_slot="$1";google_ad_width=$2;google_ad_height =$3;</script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></script>
thene use it in the posts like that
[ads=adSlotIdHere w=widthHere h=HeightHere]AdsenseIdHere[/ads]
hope thats help
Wont that amount to violation of adsense TOS, pepotiger? Since you are removing <!-- and -->
I just confirmed with adsense support they have clearly mentioned that removing space also constitute modifying your code.

I would suggest everybody to refrain from using method given above though would like to thanks pepotiger for his efforts.

Any other way... is it possible?