coComment It!!

  1. Sweet, thanks. I just started using coComment and was beginning to look at implementing the javascript necessary to integrate it with my site when I found this plugin. Worked like a charm. Thanks again.

  2. Hey Amit, this comes from someone has not bothered to look at all at how the coComment javascript functions, but is there any way the javascript inserted by this plugin could be moved up into head of the document, or better yet into external .js files that are cached and only loaded once? Wouldn’t that be more semantic? Or is there a reason they have to be in the body in the comment form? Just wondering.

  3. Nah, it can’t be moved to the head of the document. The thing is that the Javascript is not static. The plugin passes it some values regarding the post for which its being requested, like post name, permalink, whether the user requesting the post page is logged into WordPress or not, etc. So that (for now) is only possible when putting the thing in the loop. I haven’t found any other way to pass those variables to the Javascript yet(outside the loop).

    Though, I do have a workaround to have the Javascript placed in an external file(two ways actually, one is simple & other is a bit complex) but it’s not feasible right now since it might have problems working everywhere alike(needs to be tested which I’ll do). That’s why I’ve withheld it so far, since the current way is the simplest & most effective way of doing it!! 😉

  4. Duh, stupid me. Of course the title and permalink are going to change. Well, that rules out the external files, but it can still be put in the head.

    Actually you can get at post content you cant normally get at in wp_head, you just have to pull it from $posts[0] on your own. I did it in my meta keywords plugin. However, I don’t think you even need that.

    I just changed:
    add_action(‘comment_form’, ‘igCoComment_Integrate’);

    to:
    add_action(‘wp_head’, ‘igCoComment_Integrate’);

    And everything worked fine 🙂

    If it’s changing every page, I don’t think it should be in an external file. I know it could be done, but there wouldn’t be much gain. But the javascript definitely belongs in the head 🙂

    Off-topic: You made a cocomment plugin but you dont use cocomment? Your replies aren’t showing up in cocomment for me 🙁

  5. Duh, stupid me. Of course the title and permalink are going to change. Well, that rules out the external files, but it can still be put in the head.

    Actually you can get at post content you cant normally get at in wp_head, you just have to pull it from $posts[0] on your own. I did it in my meta keywords plugin.

    yeah, well, I had two reasons for putting it in comments form. Firstly, I was having a bit trouble putting it & getting right values in head, maybe I was just sleepy when I wrote this, in the wee hours. 😉 Secondly, I didn’t want to unnecessarily load Javascript when comments are diabled on a post. This still holds true(haven’t tinkered around to not load it in head when comments are off).

    If it’s changing every page, I don’t think it should be in an external file. I know it could be done, but there wouldn’t be much gain.

    Yeah, but the possible gain that I can see is that the file will be cached for the post if its called again!! Not much(since its just a few lines of JS) but still something!! 😉

    You made a cocomment plugin but you dont use cocomment? Your replies aren’t showing up in cocomment for me

    I use coComment & I’ve the plugin installed & enabled here as well, its just that I’ve turned off both the auto-enable & track-all comments features as both of them put a switch between the “Post Comment” & “Reset” buttons on my form & screws the layout. I’ll get around to fix it & then I’ll enable it. Though I’ve comment subscription facility so didn’t see any plus in enabling it!! 😉 But my blog is coComment compatible, fully(you can see the JS in page source). 🙂

  6. Ah, I didnt consider posts with comments turned off because I never do that on my site. Anyway, I am pretty sure the setting for that must be somewhere in $posts[0] and should be available in the head.

    Consider it a feature request for future versions then 🙂 It works fine not in the head, but for semantical yummyness the javascript shouldnt be in the body 🙂

  7. @redjade:
    No visual working example that I can provide for this. However, if you look into the source code of this page, you’ll see the script written in there by the plugin. This will be only useful if the commentator on your blog is logged into his/her coComment account.

    @Cody:

    Ah, I didnt consider posts with comments turned off because I never do that on my site.

    You should consider it, when writing a generic piece of software that’s supposed to be used by anyone, you should think about all scenarios, saves lots of troubleshooting time!! 😉

    Anyway, I am pretty sure the setting for that must be somewhere in $posts[0] and should be available in the head.

    Consider it a feature request for future versions then

    Sure enough!! I’ll look into it more when I get time. 🙂

Comments are closed.

Sliding Sidebar