Hi

This is a simple yet potentially lucrative tip to insert Google Adsense or Yahoo/Bing Ads (or anything really) after the first paragraph (defined by <p> tags) in all content in forum or blog posts (including member posts).

ADS IN BLOGS:

Click to enlarge preview
Here is the script to insert adverts under the first paragraph in BLOG POSTS. The red script will need to be replaced with your own Google Adsense or Yahoo/Bing ads script.

Put it in your custom code box:

<!-- Insert Ads INSIDE Blog Posts by SweetPotato -->
<div id="ad_after_jump" style="display:none;">
<!-- Advert Script START -->
<script id="mNCC" language="javascript">  medianet_width='200';  medianet_height= '200';  medianet_crid='45454545';  </script>  <script id="mNSC" src="http://contextual.media.net/nmedianet.js?cid=4545454" language="javascript"></script>
<!-- Advert Code END -->
</div><script type="text/javascript">if (typeof(x$) != 'undefined') {  x$('.xg_widget_profiles_blog_show .postbody .xg_user_generated').find('p').eq(0).after('<p style="font-weight:bold;">Continued after the jump ....</p></br><div id="ContentAdverts"></div>');    var inject_SPadverts = document.getElementById('ad_after_jump');    var SPadverts = document.getElementById('ContentAdverts');    SPadverts.innerHTML = inject_SPadverts.innerHTML; }</script>

 

ADS IN FORUM POSTS - same as above but use this code and change the red script.

<!-- Insert Ads INSIDE Forum Posts by SweetPotato -->
<div id="ad_after_jump" style="display:none;">
<!-- Advert Script START -->
<script id="mNCC" language="javascript"> medianet_width='200'; medianet_height= '200'; medianet_crid='54565767'; </script> <script id="mNSC" src="http://contextual.media.net/nmedianet.js?cid=84534343" language="javascript"></script>
<!-- Advert Code END -->
</div><script type="text/javascript">if (typeof(x$) != 'undefined') { x$('.xg_widget_forum_topic_show .description .xg_user_generated').find('p').eq(0).after('<p style="font-weight:bold;">Continued after the jump ....</p></br><div id="ContentAdverts"></div>'); var inject_SPadverts = document.getElementById('ad_after_jump'); var SPadverts = document.getElementById('ContentAdverts'); SPadverts.innerHTML = inject_SPadverts.innerHTML; }</script>


I have tested this pretty thoroughly and only come across a couple of instances where the ads weren't where I expected them to be. 95% of the time they are after the first paragraph, assuming that the html generated in the content has the correct <P>tags.

If your ads are not going to fill the width of the page, for example if they are 200px wide, and you want the following paragraph to wrap around the advert then add this css to your advanced css section:

#ContentAdverts{
width:220px;
float:left;
margin-right:15px;
}

If you want to remove the 'Continued after the jump wording then delete <p style="font-weight:bold;">Continued after the jump ....</p></br> from the code above.

Play around with it and see how you get along.

Enjoy

SP

More tips

Tags: , Insert, , , Paragraph, , Paragraph, Paragraph, Adverts, Adverts inside Blogs, Forum", Insert Adverts in Content after the First Paragraph, Paragraph, Paragraph", inside

Views: 995

Reply to This

Replies to This Discussion

Try using it on my site, it doesn't display, and may i ask, can members insert their own ads lets say in their blog posts or forum posts with this. Does it also work for comments. Thanks

nice I am surely going to try this tip. It looks great.

Hi SP. Thanks for ur great tips. Do you know how to put similar codes in photo and video section and in profile section?

RSS

Latest Activity

Rowald replied to Monica Diaz's discussion 'How are you using member categories in Ning 3.0?'
"Hi Monica, I am aware of this but thanks for your help. All this (Country) information is already…"
39 minutes ago
caro commented on kid k's group 'Ning French Networks'
"voila mon histoire et j'en pleure je prend meme des medoc kil me laisse la matrce tel kel de…"
44 minutes ago
caro commented on kid k's group 'Ning French Networks'
"kikou robert on pas t'etat d'ame ning j'ai 8 ans de ning2 mon site est plein de…"
47 minutes ago
caro commented on kid k's group 'Ning French Networks'
"mdr c pas gagner hein il est bidon ning3 je le haiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii je garde…"
49 minutes ago
Thiago Santos de Moraes replied to Elshara Silverheart's discussion 'More Feature Requests'
"Thanks, Kos. I would like to understand the reason for this, it seems that the Ning wants to…"
1 hour ago
Troy Marquis replied to Andrew Sanderson's discussion 'Video chat for ning network'
"skysa"
2 hours ago
Ambroise favorited Eric Suesz's page Ning 3.0 Roadmap
4 hours ago
Ambroise commented on kid k's group 'Ning French Networks'
"Dans le menu, il y a marqué Ning 3.0 lol"
4 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service