Edited: If you use the old code then only members can see the facebook plug-in comment box and they can comment. Please use the new code, both members and non-members can see the facebook plug-in comment box and both members and non-members can comment using facebook account. 

Hey NCs,

Hope you will be very happy after  successfully using my killer tip.

Instruction is very simple: Just copy and paste the  following code into Custom Code. You may want to change data-width follow jay's instruction here.

The Old Code

<script type="text/javascript">
x$(document).ready(function(){
x$("div.texteditor").after('<div id="fb-root"></div><div class="fb-comments"></div>');
});
</script>

The New Code

<script type="text/javascript">
x$(document).ready(function(){
x$("div#discussionReplies").before('<div id="fb-root"></div><div class="fb-comments"></div>');
});
</script>

 

 

Want to give a different look to your ning site?  Mail me at bernardmax2@gmail.com

 

Live Preview: Here

Example:

 

Tags: Add, FACEBOOK, Killer, Tip:, box, comment, every, forum, page., to

Views: 5375

Reply to This

Replies to This Discussion

Only forum is working for me...

is this Script Working for anyone Please ?

Hello Bernard!

Works for me in chrome. Looks great, very great in chrome, but don't does not appear in Internet Explorer (New code). This is the address of a discussion: 

http://defensoresdeanimales.com/forum/topics/que-mascota-tienes#.UI...

Thanks in advance!

Hi Husky,

May be is a problem with your browser.. in my IE8 i can see clearly...

Any way to get this for the videos page?

Try this...

<script type="text/javascript">
x$(document).ready(function(){
if (x$(".xg_widget_video_video_show").length > 0)
x$("p#add-comment").after('<div id="fb-root"></div><div class="fb-comments" data-width="733"></div>');
});
</script>

I updated to automatically change widths and add the proper data-href tag...

<script type="text/javascript">
//Facebook comments. Adapted from http://creators.ning.com/forum/topics/killer-tip-add-facebook-comme...
x$(document).ready(function(){
commentBox = x$("p#add-comment").parent().hide();
padding = 20;
width = commentBox.parent().width() - padding;
console.log('Facebook comment box: ' + width + 'px wide');
commentBox.before('<div id="fb-root"></div><div class="fb-comments" data-href="' + '//' + location.host + location.pathname + '" data-width="'+ width +'"></div>');
});
</script>

Would add a black or white background behind the module? And also have the option to network comments?

For this replaces the comments NING comments by Facebook, would have the 2?

Thanks and great job!

Hi Frank,

This worked brilliantly for me, but without any way to receive notifications for Facebook comments, I decided to move to Disqus, instead.  There appears to be some magic in your code that replaces the Ning comments with Facebook comments.  I'd like to do the same thing with Disqus, but only on blog comments.  I'd like to retain Ning commenting for the rest of my network.  The code I'm using works fine, except that it adds Disqus comments to the blog and it's confusing to have 2 different comment boxes on each blog.  Thanks!!

<!-- Begin Disqus Comments -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
var disqus_shortname = 'localartslive'; // required: replace example with your forum shortname

/* * * DON'T EDIT BELOW THIS LINE * * */
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>

<script type="text/javascript">
x$(document).ready(function() {
x$(".xg_blog").after('<div id="disqus_thread"></div>');
});
</script>

<!-- End Disqus Comments -->

show

I am very interested in adding the Facebook Comment Box to my website (www.cullenscorner.com). When I posted the code at the beginning of the box in the "Custom Code" Section and this is all I get:

The comments plugin requires an href parameter.

This is the code that I posted:

<script type="text/javascript">
x$(document).ready(function(){
x$("div#discussionReplies").before('<div id="fb-root"></div><div class="fb-comments"></div>');
});
</script>

What am I doing wrong? am I posting the correct code? Am I posting in the correct area? Do I need to post the code in the design studio under "Advanced and if so do I paste the code at the beginning or the end of the other codes?

Whatever you are doing is right. Only this is that probably there is problem with your fb integration. Make sure that FB integration is correct and working fine.

RSS

Latest Activity

sho allan replied to Alex's discussion 'More styling in the Design Studio'
"nice job!!!"
42 minutes ago
Fire-Tech replied to Alex's discussion 'More styling in the Design Studio'
"Good job! I would suggest a check box to move the ningbar to the bottom of the page when…"
6 hours ago
Allison Leahy replied to Allison Leahy's discussion 'What is your Ning 3.0 URL?' in the group The Sandbox
"Hi Peggy! Sorry for the slow response here. The designers used Eagle for the headlines and Gotham…"
7 hours ago
Liliana Parra replied to John Bizley's discussion 'Show Your Ning 3.0 Sites'
"Mine is here... Disaster Risk Management (Spanish) http://gestiondelriesgo.ning.com/"
7 hours ago
Allison Leahy replied to Jen's discussion 'Menu on Mobile Device Difficult'
"Absolutely! Thanks for bringing it to my attention, and for your patience as always."
7 hours ago
Allison Leahy replied to Dw Alternatio's discussion 'Any way to change to a 3.0 network?'
"Hey Dw, So glad to hear you're interested in checking out the redesign! Make sure that after…"
7 hours ago

NC for Hire
Jen replied to Jen's discussion 'Menu on Mobile Device Difficult'
"Thanks Allison. I have spent hours trying to fix this. That's great news!"
8 hours ago
Allison Leahy replied to Jen's discussion 'Menu on Mobile Device Difficult'
"Just got the word that the release had no impact the mobile menu and a feature improvement has…"
8 hours ago

© 2013   Created by Ning.

Badges  |  Report an Issue  |  Terms of Service