WordPress.org

Forums

New Plugin: CommentLuv - luv your commenters! (43 posts)

  1. fiddyp
    Member
    Posted 7 years ago #

    I've made a new plugin called CommentLuv to spread the luv to your loyal readers!

    CommentLuv appends the authors last blog post to their comment before saving it to the database. It can parse a WordPress, Blogspot or Typepad feed found in the default location, if one doesn't exist there, it parses the comment authors page for a feedburner feed and uses that instead.

    version 0.8 is available at http://www.fiddyp.co.uk/commentluv-wordpress-plugin/

    I made it with WordPress 2.2 in mind, it's been tested on a few different blogs and it's working well!

    just download, unzip, upload, activate. no template editing required.

  2. fiddyp
    Member
    Posted 7 years ago #

    now up to version 0.91 for compatibility with other comment enhancement plugins. Available from the wordpress plugins page.

  3. arcater
    Member
    Posted 7 years ago #

    Just wanted to bump this up a say that this plugin rules! Plugin of the year nomination.

  4. JSDavis82
    Member
    Posted 7 years ago #

    I've had a problem in the rendering of this plugin and though fiddy has been of great help, i've still been unable to resolve the problem.

    there is a block of text explaining that "this blog uses commentluv..." that is SUPPOSED to appear below the comment form. However, on my blog it appears above the form. Here's the code:

    some code from the plugin:

    // hooks, call comment_luv function just before comment is posted . gets passed array of comment fields
    // hooks, call add_text when comment form is shown, gets passed id of post
    add_filter('preprocess_comment','comment_luv');
    add_action('comment_form','add_text');
    
    // function to add text to bottom of form field
    function add_text($id){
    	echo "<br><em>This blog uses the <a href='http://www.fiddyp.co.uk/commentluv-wordpress-plugin'>CommentLuv plugin</a> which will try and parse your sites feed and display a link to your last post, please be patient while it tries to find it for you.</em>";
    	return $id; // need to return what we got sent
    }

    a portion of my theme's comment.php:

    <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
    
    <?php if ( $user_ID ) : ?>
    
    <p>Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="Log out of this account">Logout &raquo;</a></p>
    <table border="0" cellpadding="1" cellspacing="4" align="center" width="95%">
    
    <?php else : ?>
    
    <p>You are currently not logged into an account. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php" title="Log in to your account">Login &raquo;</a></p>
    <table border="0" cellpadding="1" cellspacing="4" align="center" width="95%">
    
    	  <tr>
    		<td width="50%">
    		  <label for="author">Name</label><br />
    		  <center><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" tabindex="1" /></center>
    		</td>
    
    		<td width="50%">
    		  <label for="email">Email</label><br />
    		  <center><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" tabindex="2" /></center>
    		</td>
    	  </tr>
    
    	  <tr>
    		<td colspan="2">
    		  <label for="url">Website URL:</label><br />
    		  <center><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" tabindex="3" /></center>
    		</td>
    	  </tr>
    
    <?php endif; ?>
    
    	  <tr>
    		<td colspan="2">
    		  <label for="comment">Message:</label><br />
    		  <center><textarea name="comment" id="comment" rows="10" cols="" tabindex="4"></textarea></center>
    		</td>
    	  </tr>
    
    	  <tr>
    		<td colspan="2">
    		  <center><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" /><input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /></center>
    		</td>
    	  </tr>
    
    <?php do_action('comment_form', $post->ID); ?>
    
    </table>
    
    </form>

    can anyone help me resolve this problem? check it out on my blog

  5. tazandpig
    Member
    Posted 7 years ago #

    I've been using this plugin for a few days now and am happy to say I think it's great!

  6. teamplaylotto
    Member
    Posted 7 years ago #

    JSD: your 'do_action' is at the bottom of your form and that's where commentluv is supposed to add it's text, you could try adding a lower priority on the add_action function of commentluv..
    add_action('comment_form','add_text',10);
    and see if that puts it in the right place..

  7. JSDavis82
    Member
    Posted 7 years ago #

    team, thanks so much for the info. i attempted the fix you recommended, but to no avail. The text remains above the comment form. any other ideas?

    thanks SO MUCH for your help!

  8. JSDavis82
    Member
    Posted 7 years ago #

    my issue is resolved, thanks to teamplay/fididyp. thanks!

  9. That’s quite clever, but you should probably consider parsing out the actual feed location from the webpage given instead of trying to work it out based on the blog type. All blogs announce their feed addresses for you, all you have to do is to look for this sort of thing: link rel="alternate" type="application/rss+xml"

    This is better than guessing based on the blog type or looking for feedburner or any of that.

    It would also have let your plugin find my latest blog post, which it can’t seem to accomplish, as far as I can see. The combination of redirects and the fact that though it's running WordPress it doesn't actually have the generator tag seems to be too much for your plugin to cope with. I'm even using feedburner, just not with a feedburner.com web address.

  10. teamplaylotto
    Member
    Posted 7 years ago #

    I have included a parsing routine in the plugin that looks for "alternate" in the head of the authors page, it doesn't rely on that to find the feed location first because not all hosting provides the ability to do 'curl' commands or open remote files with 'file' and 'fopen' and I wanted to have the most compatible way done first, the parsing routine gets called if no default feed location is used.

    also, if it is an own domain blog it will by default, try to look in /feed/ first and then /?feed=rss next, if there is an alternate link in the head then the second option should get to it.

    it is quicker to see if it is a blogspot blog by examining the author url because then no parsing is needed and the internal wordpress rss.php function will be able to read that with no problems, the code is very small and is executed at server side so it's more efficient to check the string than to open a file.

    I have a new version running as a test on my blog and it's having great success with removing nofollow and also parsing blogspot blogs hosted on their own domain which I only found out because of the feedback I get from people that use it and people that code like you. I hope to get commentluv working on as many, and parsing as many blogs as possible so I appreciate your input.

    there are improvements to the cache of the feeds too and an ability to make it show the debug info to make tracking down of errant blogs easier..

    I hope you get a chance to use the new version when it's released soon and spread the luv ;-)

    Andy Bailey of fiddyp.co.uk

  11. I don't understand. If you can't pull the main blog page itself (via whatever method), then you can't pull the feed either, so it's kinda pointless to know the feed address at that point.

    Yes, pulling the page is an extra request, and you can skip it for wordpress.com or blogspot.com or other commonplace blogging services. But for all other blogs that are not on these services, you have to pull the page anyway, so getting the alternate URL is the best way. Trying to get /feed/ and /?feed=rss2 first is rather a waste of time.

    I see where you're checking for the alternate in the code, that's not really the best way to do it, but it is simple and easy, I suppose. But it will probably miss some blogs where the link gets spread across multiple lines. And on some other blogs, it might pick up the comments feed, which would be weird.

  12. ingaoz
    Member
    Posted 7 years ago #

    Fantastic plugin! Thank you :)

  13. snowlark
    Member
    Posted 7 years ago #

    YEAH!!!

    I am so VERY HAPPY that you now can support those of us with host providers that will not let us use curl - which I use on my own, they just don't support it (grrr).

    THANK YOU THANK YOU THANK YOU!!!

    :)

    My Staff IT Right blog thanks you!

    http://staffitright.com/blog

  14. teamplaylotto
    Member
    Posted 7 years ago #

    thanks for letting me know snowlark! I have wanted to do that for some time so that as many blogs as possible can use the autodiscover link in the head of the authors page.

    my next step is to ajax the process so that the last post gets found while the author is typing away in the comment box.
    I've got it working on a local install but it's using prototype.js which causes my blog to hang when I include it in the header so I need to work out a better way for getting a working event listener..

    thanks for the luv!

  15. stshores24
    Member
    Posted 7 years ago #

    Awesome plugin! I just wish I could get it to work properly with Nofollow Free (http://www.michelem.org/wordpress-plugin-nofollow-free/).

  16. teamplaylotto
    Member
    Posted 7 years ago #

    stshores: what blog are you trying it on? if you look at comments in the admin or email notification then wordpress will add the nofollow attribute, if you check the source of the page with commentluv installed then the links should show no nofollow.

  17. Delete Me
    Member
    Posted 7 years ago #

    I don't use this plugin but I surf blogs that do. I want to like it but it never, and I mean NEVER succeeds in getting my latest feed. If it works at all, then it's always grabbing a post I made days weeks, even over a month ago rather than my latest entry. I think it has a problem with blogs which use the FeedSmith plugin to redirect their feedburner feeds. That's my guess at least.

  18. mommyknows
    Member
    Posted 7 years ago #

    I downloaded and installed the plugin today ... but commenters are getting this error when they post a comment.

    Warning: comment_luv(/home/httpd/vhosts/mommyknows.com/httpdocs/blog/wp-includes/rss.php): failed to open stream: No such file or directory in /home/httpd/vhosts/mommyknows.com/httpdocs/blog/wp-content/plugins/commentluv.php on line 169

    Warning: comment_luv(): Failed opening '/home/httpd/vhosts/mommyknows.com/httpdocs/blog/wp-includes/rss.php' for inclusion (include_path='.:/usr/local/lib/php') in /home/httpd/vhosts/mommyknows.com/httpdocs/blog/wp-content/plugins/commentluv.php on line 169

    Fatal error: Call to undefined function: fetch_rss() in /home/httpd/vhosts/mommyknows.com/httpdocs/blog/wp-content/plugins/commentluv.php on line 226

    Any suggestions?

    I'd love to be able to use it?

    *Apologies in advance if this is an obvious problem ... I am not very good at this stuff!

  19. teamplaylotto
    Member
    Posted 7 years ago #

    Your blog is less than 2.1 so it doesn't include the magpie functions and that's what is causing the error. The version I sent you has a folder with the includes but I think that also sometimes gives errors.

    Sorry about that! hopefully your host will updgrade their wordpress scripts..

  20. ruicruz
    Member
    Posted 7 years ago #

    Hi,

    There is a problem with your plugin with special charaters.

    "Tr�s dicas para rentabilizar um feed" from my feed at ruicruz.forunsbb.com, for example.

    Can you do something about this in the next realease?

    Thanks,
    Rui

  21. Corrina007
    Member
    Posted 7 years ago #

    CommentLuv doesn't pick up my feed. I can't figure out why! I'm using a WordPress platform, on my own server. :-(

  22. ocmega
    Member
    Posted 7 years ago #

    @teamplaylotto: regarding stshores24 post about WP still adding the nofollow attribute - you pointed out that the source code of the page will reveal there is NO nofollow attrib. you are correct. is that what the search engines see? as the whole point of the "nofollow" movement is to avoid WP's nofollow. Sorry if I'm not clear.

  23. teamplaylotto
    Member
    Posted 7 years ago #

    yes ocmega, search engines see exactly what you see when you click "view source" on a page (unless you have special code for spiders and bots).

  24. Nicki Faulk
    Member
    Posted 7 years ago #

    I've been using this plugin for a short while and love it. However, I have noticed that it adds in the nofollow code, despite the fact that I am using (the latest version of) Denis de Bernardy's DoFollow plugin.

    Any chances support will be added soon for this plugin?

  25. teamplaylotto
    Member
    Posted 7 years ago #

    I made a comment on your blog and checked it for nofollow and it didn't have it. You may be seeing the nofollow bit when you get notified of comments by email or within the WP admin section but if you check the source of the page itself then you will see that the comments are do follow

    thanks for spreading the luv!

  26. Nicki Faulk
    Member
    Posted 7 years ago #

    Hrm, you're right. It shows it if I edit a comment, and it shows in the email alerting me to new comments, but it's no longer actually ON the site. Thank you for clearing this up. :)

  27. fool4Christ
    Member
    Posted 7 years ago #

    I changed the add_text() function to comment_luv_add_text(), modifying it in such a way that the "Enable CommentLuv" checkbox can be manually added to a theme anywhere in the comment form above the do_action() call. You can see the modified plugin code here:

    http://pastebin.com/f702cfdfe

    I borrowed the idea/method from the Subscribe to Comments plugin. I'm now including the CommentLuv bit in my theme with this code:

    <?php if (function_exists('comment_luv_add_text')) { comment_luv_add_text(); } ?>

    That's added in my theme's comments.php file, just above the HTML for the comment form submit button.

    Just thought I'd share, in case anyone else finds that useful.

  28. hsmombrc
    Member
    Posted 7 years ago #

    I love this plugin! My question is just a cosmetic one...is it possible to put a space or line between the end of the person's comment and the commentluv information? I tried various things but none of them were effective to place a space or line in the right spot.

    Thanks for your hard work!

  29. zoeyjane
    Member
    Posted 7 years ago #

    I've just switched to a new theme - and now new Comment Love isn't appearing, nor is the notification. Being that I really only understand the bare minimums of css/html, could you please take a look and let me know how I can run it, again?

    Thank you.

  30. webwenchginger
    Member
    Posted 7 years ago #

    I installed this, and added a bit of text (scroll up just a little to see it) to the comment area to encourage posting comments, this plugin was a great idea! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Topic