Thomas Freudenberg

Confessions of a caffeine addict

Updated coComment support for Community Server 2.1

Yesterday the guys at coComment updated their scripts. They also refreshed the example for Community Server, but that's targetting CS 2.0. There are some breaking changes in the API of CS 2.1, so that code won't work with Telligent's latest release. Keyvan Nayyeri updated the code some time ago. I polished it a little bit and incorporated the latest changes from coComment:

<%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Blogs.Components" %>
 
<% CSContext context = CSContext.Current; %>
<% Weblog currentBlog = Weblogs.GetWeblog(context.ApplicationKey); %>
<% BlogThreadQuery query = new BlogThreadQuery(); %>
<% query.PostID = context.PostID; %>
<% if (context.PostName != null) { %>
<% query.PostName = context.PostName; %>
<% } %>
<% query.IncludeCategories = false; %>
<% query.ReturnFullThread = false; %>
<% query.SectionID = currentBlog.SectionID; %>
<% PostSet postSet = WeblogPosts.GetPosts(query, true); %>
<% postSet.Organize(); %>
<% WeblogPost blogPost = postSet.ThreadStarter as WeblogPost; %>
<% bool isAuthor = context.IsAuthenticated; %>
 
<script type="text/javascript">
coco =
{
    tool     : "<%= SiteStatistics.CommunityServerVersionVersionInfo %>",
    siteurl    : "<%= Globals.FullPath(currentBlog.Url) %>",
    sitetitle : "<%= currentBlog.Name %>",
    pageurl    : "<%= Globals.FullPath(BlogUrls.Instance().Post(blogPost)) %>",
    pagetitle : "<%= blogPost.Subject %>",<% if (isAuthor) { %>
    author     : "<%= context.User.DisplayName %>",<% } else{ %>
    authorID : "<%= tbName.UniqueID %>",<% } %>
    formID     : "aspnetForm",
    textareaID : "<%= tbComment.UniqueID %>",
    buttonID : "<%= btnSubmit.UniqueID %>"
}
</script>
<script id="cocomment-fetchlet" src="http://www.cocomment.com/js/enabler.js"
type="text/javascript">
</script>

If you run CS 2.1 on ASP.NET 1.1, you have to change formID from "aspnetForm" to "__aspnetForm".

What I don't understand however is why the xxxID variables require the name of the related control instead of the ID.

Comments

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# September 19, 2006 3:05 PM

Keyvan Nayyeri said:

Welld done Thomas :-)

I still don't want to use their services and install it on my blog although they had great improvements.

# September 20, 2006 1:38 AM

Community Server Daily News said:

from the editor's desk occasional messages that don't fit anywhere else Greetings from Telligent Corporate

# September 21, 2006 12:52 PM

Thomas Freudenberg said:

I just upgraded my site to Community Server 2.1 SP1. I wouldn't post this if I did not encounter an issue,

# November 14, 2006 4:38 PM

Daily News Faq List said:

Thomas Freudenberg provides us with updated coComment support code for Community Server 2.1 on both ASP.NET

# November 22, 2006 8:15 AM

bindhiya said:

Can u help me out with the code for enabling co comment services in my Community Server if i am using AspNet 2.1.

for the reply u can mail me at bindhiya_nambiar@yahoo.com

# November 29, 2006 9:14 PM

Ancora Imparo said:

Based on a lot of positive feedback from yesterday's post on the FeedBurner integration, I am curious

# January 19, 2007 7:52 AM

Community Server Bits said:

Thomas Freudenberg provides us with updated coComment support code for Community Server 2.1 on both ASP.NET

# March 12, 2007 8:21 AM

Thomas Freudenberg said:

If you are one of my two regular readers, you may have noticed that I published many posts regarding

# April 23, 2007 3:38 PM