Can I replace comments of blog with Facebook comment (social plugin)

Topics: ASP.NET 2.0, Controls
May 12, 2013 at 1:50 AM
Edited May 12, 2013 at 2:29 AM
Can I replace comments of blog with Facebook comment (social plugin)?
If can, what Extension i must install?
Image
Jun 29, 2013 at 5:10 PM
please help me
Jun 30, 2013 at 10:35 AM
Edited Jun 30, 2013 at 10:40 AM
The placement of the facebook code will vary from theme to theme.
You want to be looking for the file PostView.ascx in your current theme folder.
In the BE2.8 classic theme, facebook code insertion would be something like below, commented with facebook start and end.
<%@ Control Language="C#" AutoEventWireup="true" EnableViewState="false" Inherits="BlogEngine.Core.Web.Controls.PostViewBase" %>

<div class="post xfolkentry" id="post<%=Index %>">
  <h1><a href="<%=Post.RelativeOrAbsoluteLink %>" class="taggedlink"><%=Server.HtmlEncode(Post.Title) %></a></h1>
  <span class="author">by <a href="<%=BlogEngine.Core.Utils.AbsoluteWebRoot + "author/" + BlogEngine.Core.Utils.RemoveIllegalCharacters(Post.Author) + BlogEngine.Core.BlogConfig.FileExtension %>"><%=Post.AuthorProfile != null ? Post.AuthorProfile.DisplayName : Post.Author %></a></span>
  <span class="pubDate"><%=Post.DateCreated.ToString("d. MMMM yyyy HH:mm") %></span>
  
  <div class="text"><asp:PlaceHolder ID="BodyContent" runat="server" /></div>
  <div class="bottom">
    <%=Rating %>
    <p class="tags">Tags: <%=TagLinks(", ") %></p>
    <p class="categories"><%=CategoryLinks(" | ") %></p>
  </div>

  <div class="footer">    
    <div class="bookmarks">
      <a rel="nofollow" title="Index <%=Index %>" target="_blank" href="http://www.dotnetkicks.com/submit?url=<%=Server.UrlEncode(Post.AbsoluteLink.ToString()) %>&amp;title=<%=Server.UrlEncode(Post.Title) %>">Submit to DotNetKicks...</a>
    </div>
    
    <%=AdminLinks %>

    <!-- Start of BE/Disqus -comment me out

    <% if (BlogEngine.Core.BlogSettings.Instance.ModerationType == BlogEngine.Core.BlogSettings.Moderation.Disqus)
       { %>

    <a rel="nofollow" href="<%=Post.PermaLink %>#disqus_thread"><%=Resources.labels.comments %></a>
    <%}
       else
       { %>
    <a rel="bookmark" href="<%=Post.PermaLink %>" title="<%=Server.HtmlEncode(Post.Title) %>">Permalink</a> |
    <a rel="nofollow" href="<%=Post.RelativeOrAbsoluteLink %>#comment"><%=Resources.labels.comments %> (<%=Post.ApprovedComments.Count %>)</a>   
    <%} %>

    end BE/Disqus -->


    <!-- Facebook start -->
    <fb:comments-count href="<%=Post.PermaLink %>"></fb:comments-count> <%=Resources.labels.comments %>
    <div id="fb-root"></div>
    <script>    
        (function (d, s, id) {
            var js, fjs = d.getElementsByTagName(s)[0];
            if (d.getElementById(id)) return;
            js = d.createElement(s); js.id = id;
            js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1";
            fjs.parentNode.insertBefore(js, fjs);
        } (document, 'script', 'facebook-jssdk'));
    </script>
    
    <div class="fb-comments" data-href="<%=Post.PermaLink %>" data-width="470" data-num-posts="10"></div>
    <!-- Facebook end -->


    </div>
</div>