|
|
|||||||||||||
|
|
||||||||||||
|
|
|||||||||||||
Integrate
The general codeWith the code below, coComment will work in an optimal way on your blog:
JavaScript to add to your blog templateThe following code should be added to the pages where your comment form appears:
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "MyBlogTool",
siteurl : "http://example.com/~myblog",
sitetitle : "Tom's Great Blog Title",
pageurl : "http://example.com/~myblog/?p=42",
pagetitle : "My \"Incredible\" Post",
author : "Douglas Adams",
formID : "commentform",
textareaID : "comment",
buttonID : "submit"
}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Note: the old code previously provided here still works, but is deprecated.
tool authorOR authorID authorformIDOR formName OR formNumber formID If you prefer not to specify the type attribute in each of the script elements, you can omit it and add the following meta tag to your page header: <meta http-equiv="Content-Script-Type" content="application/javascript" /> Example for WordPressWith WordPress, the easiest way to integrate coComment into your blog is to use the
coComment Enhancer plugin, which injects the necessary code into your template.
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "WordPress",
siteurl : "<?php echo get_option('home'); ?>",
sitetitle : "<?php bloginfo('name'); ?>",
pageurl : "<?php the_permalink() ?>",
pagetitle : "<?php the_title(); ?>",
formID : "commentform",
textareaID : "comment",
<?php if ( $user_ID ) : ?>
author : "<?php echo $user_identity; ?>",
<?php else : ?>
authorID : "author",
<?php endif; ?>
buttonID : "submit"
}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Note: the
Example for TextPattern
By adding the following code to the
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "TextPattern",
siteurl : "Replace with URL of your blog",
sitetitle : "Replace with Title of your blog",
pageurl : "URL of your blog then add the following: /?id=",
/* e.g. "http://www.ballpark.ch/blog/?id=", */
pagetitle : "
Example for Serendipity s9y.org
Use the following code provided by Beat Menzi to make Serendipity blogs compatible with coComment. (included in
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{ldelim}
tool : "Serendipity",
siteurl : "{$serendipityBaseURL|@escape:javascript}",
sitetitle : "{$blogTitle|@escape:javascript}",
pageurl : "{$commentform_entry.rdf_ident|@escape:javascript}",
pagetitle : "{$commentform_entry.title|@escape:javascript}",
author : "{$commentform_name}",
authorID : "serendipity[name]",
formID : "serendipity_comment",
textareaID : "serendipity[comment]",
buttonID : "serendipity[submit]"
{rdelim}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Example for Expression Engine
submitted by
{exp:weblog:entries}
...
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "ExpressionEngine",
siteurl : "{homepage}",
sitetitle : "{exp:weblog:weblog_name weblog="your_weblog_name"}",
pageurl : "{title_permalink=template_group/comments}",
pagetitle : "{title}",
authorID : "name",
formID : "comment_form",
textareaID : "comment",
buttonID : "submit"
}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Example for Pivot (pivotlog.net)
submitted by
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "Pivot",
siteurl : "Fill in your own website",
sitetitle : "[[weblogtitle]]",
pageurl : "[[self]]",
pagetitle : "[[title]]",
author : "[[cookie:name]]",
formID : "form",
textareaID : "piv_comment",
buttonID : "post"
}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Example for b2evolution
submitted by
First, you need to edit the /skins/_feedback.php file. Most of the changes is adding a section of javascript, but there is one line that has to be modified. Look for a line that begins with '<form action', then a bunch of other stuff, and finished off by a '>'. Now, add 'name="commentForm"' (without the single quotes) inside the final '>'.
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "b2evolution",
siteurl : "<?php $Blog->disp('blogurl', 'raw');?>",
sitetitle : "<?php $Blog->disp('name', 'htmlhead');?>",
pageurl : "<?php $Item->permalink(); ?>",
pagetitle : "<?php $Item->title(); ?>",
author : "{$commentform_name}",
formID : "commentForm",
textareaID : "comment",
buttonID : "submit",
<?php if(is_logged_in()) { ?>
author : "<?php $current_User->prefered_name(); ?>"
<?php } else { ?>
authorID : "author"
<?php } ?>
}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Example for MovableType
submitted by
These instructions are for the default installation of MT 3.2 - if you've made changes to the templates, you will have to locate the corresponding sections in order to make the required changes.
</form>
</div>
</MTIfCommentsActive>
and change them to:
</form>
</div>
<MTIfCommentsAccepted>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
</MTIfCommentsAccepted>
</MTIfCommentsActive>
Save the template.
Example for Community Serversubmitted by Keyvan Nayyeri, Jayson Knight andThomas Freudenberg
This is code for Community Server 2.0 Beta 2 (and all 2.0 Beta versions in general), add it to <%@ Import Namespace="CommunityServer.Components" %>
<%@ Import Namespace="CommunityServer.Blogs.Components" %>
<% WeblogPost currentPost = WeblogPosts.GetWeblogEntry(CSContext.Current.BlogGroupID,CSContext.Current.PostID); %>
<% bool isAuthor = CSContext.Current.IsAuthenticated &&CSContext.Current.User.UserID == currentPost.AuthorID; %>
<script type="text/javascript">
// this ensures coComment gets the correct values
coco =
{
tool : "communityServer",
siteurl : "<%=Globals.FullPath(currentPost.Weblog.HomePage) %>",
sitetitle : "<%=currentPost.Weblog.Name %>",
pageurl : "<%=Globals.FullPath(BlogUrls.Instance().Post(currentPost)) %>",
pagetitle : "<%=currentPost.Subject %>",
formID : "__aspnetForm",
textareaID : "<%=tbComment.UniqueID %>",
buttonID : "<%=btnSubmit.UniqueID %>",
<% if (isAuthor) { %>
author : "<%=CSContext.Current.User.DisplayName %>"
<% } else{ %>
authorID : "<%=tbName.UniqueID %>"
<% } %>
}
</script>
<script id="cocomment-fetchlet" src="http://www2.cocomment.com/js/enabler.js" type="text/javascript">
// this activates coComment
</script>
Plugin for SPIPThanks to Please see You might also want to Please let If you have any issues with integrating coComment into your site, or are looking for coComment to power the conversations directly without your having to store them locally please contact us at integration@cocomment.com. |
||||||
|
||||||