Cocomment Comment Montoring and b2evolution

posted on 03/26/06 at 11:44:18 pm by Joel Ross

I'm not sure I've even mentioned CoComment before, but I've been trying to play with it a bit lately. It doesn't work very well with Maxthon or (for me) Internet Explorer (it says cookies aren't enabled or not stored properly, and that I'm not logged in over and over), but it does work nicely with Firefox. Finally - a good way for me track comments. But there's a problem - it only works well with certain blogging platforms. And they have a solution - you can manually integrate your own blog.

There were no samples for b2evolution, so I decided to go ahead do it. For others who use b2evo, below are the instructions to integrate CoComment into your blog.

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 '>'.

Then, you add this chunk of javascript:

   1:  <script type="text/javascript">
   2:      var blogTool              = "b2evolution";
   3:      var blogURL               = "<?php $Blog->disp('blogurl', 'raw');?>";
   4:      var blogTitle             = "<?php $Blog->disp('name', 'htmlhead');?>";
   5:      var postURL               = "<?php $Item->permalink(); ?>";
   6:      var postTitle             = "<?php $Item->title(); ?>";
   7:      var commentTextFieldName  = "comment";
   8:      var commentButtonName     = "submit";
   9:      var commentAuthorLoggedIn = <?php if(is_logged_in()) { echo "true"; } else { echo "false"; }?>;
  10:      <?php if(is_logged_in()) { ?>
  11:      var commentAuthor         = "<?php $current_User->prefered_name(); ?>";
  12:      <?php } else { ?>
  13:      var commentAuthorFieldName = "author";
  14:      <?php } ?>
  15:      var commentFormName       = "commentForm";
  16:  </script>

That's it. Now, you can add one more line to active CoComment automatically, but I didnt' go that far.

The cool thing about CoComment is that now, I could put up a display of the places that I've commented at recently, so then people can see other places that I'm involved in the comments. Plus, since I don't offer per comment feeds, if everyone used CoComment, then it wouldn't be needed.

Technorati Tags: |

Categories: Blogging