<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>
<channel>
	<title>Comments on: WordPress Plugin: Rate Your Comments (Comment Karma)</title>
	<atom:link href="http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/</link>
	<description>Computer related blog</description>
	<pubDate>Wed, 20 Aug 2008 17:53:14 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
		<item>
		<title>By: Sven</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-72102</link>
		<dc:creator>Sven</dc:creator>
		<pubDate>Fri, 25 Jul 2008 11:58:50 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-72102</guid>
		<description>@confuzed:

There's actuall a small problem with solving the "--" issue. You still need to define the prefix as blank otherwise it prints it as "undefined" on the page :P

As for the single vote per user and other features I have mentioned, Alex has contacted me about these. I'm going to start working on making these features configurable and once done will send it to Alex for review.</description>
		<content:encoded><![CDATA[<p>@confuzed:</p>
<p>There&#8217;s actuall a small problem with solving the &#8220;&#8211;&#8221; issue. You still need to define the prefix as blank otherwise it prints it as &#8220;undefined&#8221; on the page :P</p>
<p>As for the single vote per user and other features I have mentioned, Alex has contacted me about these. I&#8217;m going to start working on making these features configurable and once done will send it to Alex for review.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Schleber</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-72096</link>
		<dc:creator>Alex Schleber</dc:creator>
		<pubDate>Thu, 24 Jul 2008 23:56:54 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-72096</guid>
		<description>I had the issue with the repeat-voting allowed on the greyed-out thumbs as well, fixed it by trimming some things from processAjax() and setKarma(), and changing how canVote() looks up the post ID, specifically, I am now passing this in from processAjax().

I think the look-up of the postID failed in canVote() before a refresh of the page, so that the query returned no result and hence allowed more votes.

BTW, I have left the IP check on, this is needed as I don't even allow user reg on my blog (it's a security risk).

I will post my code here:

http://bizpsyq.com/code/ckarma_class_php.txt

Note that I moved some things around for debugging purposes, so just do a search for

"function canVote(" 

and read from there.</description>
		<content:encoded><![CDATA[<p>I had the issue with the repeat-voting allowed on the greyed-out thumbs as well, fixed it by trimming some things from processAjax() and setKarma(), and changing how canVote() looks up the post ID, specifically, I am now passing this in from processAjax().</p>
<p>I think the look-up of the postID failed in canVote() before a refresh of the page, so that the query returned no result and hence allowed more votes.</p>
<p>BTW, I have left the IP check on, this is needed as I don&#8217;t even allow user reg on my blog (it&#8217;s a security risk).</p>
<p>I will post my code here:</p>
<p><a href="http://bizpsyq.com/code/ckarma_class_php.txt" rel="nofollow" target="_blank"></a><a href='http://bizpsyq.com/code/ckarma_class_php.txt' target="_blank">bizpsyq.co...ss_php.txt</a></p>
<p>Note that I moved some things around for debugging purposes, so just do a search for</p>
<p>&#8220;function canVote(&#8221; </p>
<p>and read from there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: confuzed</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-72095</link>
		<dc:creator>confuzed</dc:creator>
		<pubDate>Thu, 24 Jul 2008 23:14:29 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-72095</guid>
		<description>Sven, I'm interested!  Particularly in how you removed the IP check but allowed only one vote per comment.  My install has a strange bug where you can repeatedly click on the icon to register multiple votes - it won't lock you out of voting more until the page has been refreshed.  I'm assuming its conflicting with another ajax plugin, but not sure.  

I really want to be able to tell it to only count the first click, but I'm too much of a noob to figure it out.

I agree this is a great script though, if I could only get it working properly!</description>
		<content:encoded><![CDATA[<p>Sven, I&#8217;m interested!  Particularly in how you removed the IP check but allowed only one vote per comment.  My install has a strange bug where you can repeatedly click on the icon to register multiple votes - it won&#8217;t lock you out of voting more until the page has been refreshed.  I&#8217;m assuming its conflicting with another ajax plugin, but not sure.  </p>
<p>I really want to be able to tell it to only count the first click, but I&#8217;m too much of a noob to figure it out.</p>
<p>I agree this is a great script though, if I could only get it working properly!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kristian</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71943</link>
		<dc:creator>Kristian</dc:creator>
		<pubDate>Tue, 15 Jul 2008 07:30:36 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71943</guid>
		<description>Alex, good plug-in, I had a hard time installing (at first)...however. I changed some values from your ck-karma.php, instead of using the wordpress: bloginfo('template_directory')php command...instead use get_settings('siteurl')... THIS made my install work...Im sure it will help out alot...some of us have a different install path.</description>
		<content:encoded><![CDATA[<p>Alex, good plug-in, I had a hard time installing (at first)&#8230;however. I changed some values from your ck-karma.php, instead of using the wordpress: bloginfo(&#8217;template_directory&#8217;)php command&#8230;instead use get_settings(&#8217;siteurl&#8217;)&#8230; THIS made my install work&#8230;Im sure it will help out alot&#8230;some of us have a different install path.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sven</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71873</link>
		<dc:creator>Sven</dc:creator>
		<pubDate>Sat, 12 Jul 2008 13:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71873</guid>
		<description>Any reason why it returns negative ratings as “–X” rather than “-X”? Why the double dash?


In ck_karma.js line 61, replace the if else statement with
if(response[2] &#62; 0){
                    var prefix = '+';
                }

and in ck_karma.php line 73 do something similar
if($karma &#62; 0) {
				$karma = '+'. $karma;
			}

the values are actually stored as negative in the DB so the prefix isn't needed. I have also changed ck_karma with the following features if anyone is interested:
- Removed the IP check and allowed each registered user to only vote once per comment.
- Only allow registered users to rate comments
- disable voting when the post has comments disabled

I need to make these configurable really, but there you go :) These are just some hacks I did to get this great script to work how I wanted :)</description>
		<content:encoded><![CDATA[<p>Any reason why it returns negative ratings as “–X” rather than “-X”? Why the double dash?</p>
<p>In ck_karma.js line 61, replace the if else statement with<br />
if(response[2] &gt; 0){<br />
                    var prefix = &#8216;+&#8217;;<br />
                }</p>
<p>and in ck_karma.php line 73 do something similar<br />
if($karma &gt; 0) {<br />
				$karma = &#8216;+&#8217;. $karma;<br />
			}</p>
<p>the values are actually stored as negative in the DB so the prefix isn&#8217;t needed. I have also changed ck_karma with the following features if anyone is interested:<br />
- Removed the IP check and allowed each registered user to only vote once per comment.<br />
- Only allow registered users to rate comments<br />
- disable voting when the post has comments disabled</p>
<p>I need to make these configurable really, but there you go :) These are just some hacks I did to get this great script to work how I wanted :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steelfrog</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71747</link>
		<dc:creator>steelfrog</dc:creator>
		<pubDate>Sun, 06 Jul 2008 20:56:24 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71747</guid>
		<description>Any reason why it returns negative ratings as "--X" rather than "-X"? Why the double dash?</description>
		<content:encoded><![CDATA[<p>Any reason why it returns negative ratings as &#8220;&#8211;X&#8221; rather than &#8220;-X&#8221;? Why the double dash?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: tigerdgo</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71594</link>
		<dc:creator>tigerdgo</dc:creator>
		<pubDate>Tue, 01 Jul 2008 18:28:31 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71594</guid>
		<description>I've got this working and it's great! But I have two problems:

1) I'm using Wordpress Thread Comment (http://blog.2i2j.com/plugins/wordpress-thread-comment)
to create-- yes-- threaded comments, and I can't figure out how to make CK show up within the threaded comments. It works great for the original comments, but doesn't display in the responses. How can I get it to work in the threaded responses to a comment?

2) As a convenience for my impatient readers, I also have Inline Ajax Comments installed, so comments can be accessed at the bottom of each post. That works fine (I know: it's not supported any more) but is there a way to get CK to work in those comments as well?</description>
		<content:encoded><![CDATA[<p>I&#8217;ve got this working and it&#8217;s great! But I have two problems:</p>
<p>1) I&#8217;m using Wordpress Thread Comment (http://blog.2i2j.com/plugins/wordpress-thread-comment)<br />
to create&#8211; yes&#8211; threaded comments, and I can&#8217;t figure out how to make CK show up within the threaded comments. It works great for the original comments, but doesn&#8217;t display in the responses. How can I get it to work in the threaded responses to a comment?</p>
<p>2) As a convenience for my impatient readers, I also have Inline Ajax Comments installed, so comments can be accessed at the bottom of each post. That works fine (I know: it&#8217;s not supported any more) but is there a way to get CK to work in those comments as well?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: steelfrog</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71368</link>
		<dc:creator>steelfrog</dc:creator>
		<pubDate>Wed, 25 Jun 2008 18:20:01 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-71368</guid>
		<description>I ran into the 'gray buttons' problem as well. I had to deactivate the plugin, drop the SQL table (wp_ck_karma) and re-activate the plugin, which re-built the table.

Works fine now.</description>
		<content:encoded><![CDATA[<p>I ran into the &#8216;gray buttons&#8217; problem as well. I had to deactivate the plugin, drop the SQL table (wp_ck_karma) and re-activate the plugin, which re-built the table.</p>
<p>Works fine now.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: taddict</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-70295</link>
		<dc:creator>taddict</dc:creator>
		<pubDate>Tue, 20 May 2008 14:16:55 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-70295</guid>
		<description>is this plugin still in development?</description>
		<content:encoded><![CDATA[<p>is this plugin still in development?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Schleber</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-70132</link>
		<dc:creator>Alex Schleber</dc:creator>
		<pubDate>Fri, 16 May 2008 23:45:38 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-70132</guid>
		<description>I finally got around to creating the function to return the top-rated comment
for a given post:

function get_top_comment($postId) {
   global $wpdb;
         $sql = "SELECT comment_ID, comment_date, comment_author, comment_author_url, comment_content, SUM(ckTbl_rating) AS ratings_total
FROM wp_ckTbl_commentMain, wp_comments
WHERE ckTbl_comment_id = comment_ID
AND comment_post_ID = $postId
GROUP BY ckTbl_comment_id
ORDER BY ratings_total DESC, comment_date ASC;";   // the date is the tie-braker, earlier comment wins

   $comments = $wpdb-&#62;get_results($sql);
   $topcmt = $comments[0];    // take the top-most one, we have sorted for it to be the top comment
         if (!$topcmt-&#62;comment_ID) $topcmt=0;    // if it's not set, return 0
   return $topcmt;
}

in ckarma.php:

function get_top_comment($postId) {
   global $ckarma;
   $topcmt = $ckarma-&#62;get_top_comment($postId);
   return $topcmt;
}

then use

$topcmt = get_top_comment(get_the_ID());

$topcmt-&#62;comment_author

and so forth in e.g. the while(have_posts()) loop in your index.php to do stuff with the top comment, or place elsewhere in your templates or custom widgets. 

Watch this function in action on my blog:

&lt;a href="http://businessmindhacks.com" rel="nofollow"&gt;http://businessmindhacks.com&lt;/a&gt;
(top comment excerpt with DoFollow link displayed if present for every post on the index page)

Best - Alex</description>
		<content:encoded><![CDATA[<p>I finally got around to creating the function to return the top-rated comment<br />
for a given post:</p>
<p>function get_top_comment($postId) {<br />
   global $wpdb;<br />
         $sql = &#8220;SELECT comment_ID, comment_date, comment_author, comment_author_url, comment_content, SUM(ckTbl_rating) AS ratings_total<br />
FROM wp_ckTbl_commentMain, wp_comments<br />
WHERE ckTbl_comment_id = comment_ID<br />
AND comment_post_ID = $postId<br />
GROUP BY ckTbl_comment_id<br />
ORDER BY ratings_total DESC, comment_date ASC;&#8221;;   // the date is the tie-braker, earlier comment wins</p>
<p>   $comments = $wpdb-&gt;get_results($sql);<br />
   $topcmt = $comments[0];    // take the top-most one, we have sorted for it to be the top comment<br />
         if (!$topcmt-&gt;comment_ID) $topcmt=0;    // if it&#8217;s not set, return 0<br />
   return $topcmt;<br />
}</p>
<p>in ckarma.php:</p>
<p>function get_top_comment($postId) {<br />
   global $ckarma;<br />
   $topcmt = $ckarma-&gt;get_top_comment($postId);<br />
   return $topcmt;<br />
}</p>
<p>then use</p>
<p>$topcmt = get_top_comment(get_the_ID());</p>
<p>$topcmt-&gt;comment_author</p>
<p>and so forth in e.g. the while(have_posts()) loop in your index.php to do stuff with the top comment, or place elsewhere in your templates or custom widgets. </p>
<p>Watch this function in action on my blog:</p>
<p><a href="http://businessmindhacks.com" rel="nofollow" target="_blank"></a><a href='http://businessmindhacks.com' target="_blank">businessmi...dhacks.com</a><br />
(top comment excerpt with DoFollow link displayed if present for every post on the index page)</p>
<p>Best - Alex</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wrongling</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-70085</link>
		<dc:creator>wrongling</dc:creator>
		<pubDate>Thu, 15 May 2008 16:47:35 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-70085</guid>
		<description>Thanks for the extra code snippets everyone - this plugin has so much potential.  How difficult would it be to highlight every comment rated above a certain threshold with a css style? (ie every comment rated +20 or above gets a colored background to highlight it, or an icon, gold star, etc).</description>
		<content:encoded><![CDATA[<p>Thanks for the extra code snippets everyone - this plugin has so much potential.  How difficult would it be to highlight every comment rated above a certain threshold with a css style? (ie every comment rated +20 or above gets a colored background to highlight it, or an icon, gold star, etc).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Schleber</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69937</link>
		<dc:creator>Alex Schleber</dc:creator>
		<pubDate>Mon, 12 May 2008 05:08:58 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69937</guid>
		<description>Here is the example code for the DoFollow link suppression on spammy comments (note that the threshold for this would be set to lower than for "bury"

if (get_comment_author_url() &#38;&#38; ($karma &#62; -5)) { 
   display comment_author() inside of comment_url() link ... 
} else {
   display comment_author() only
}</description>
		<content:encoded><![CDATA[<p>Here is the example code for the DoFollow link suppression on spammy comments (note that the threshold for this would be set to lower than for &#8220;bury&#8221;</p>
<p>if (get_comment_author_url() &amp;&amp; ($karma &gt; -5)) {<br />
   display comment_author() inside of comment_url() link &#8230;<br />
} else {<br />
   display comment_author() only<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Schleber</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69936</link>
		<dc:creator>Alex Schleber</dc:creator>
		<pubDate>Mon, 12 May 2008 05:03:50 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69936</guid>
		<description>Hi,

I was wondering how the "bury" is actually implemented, since I couldn't find anything about it in your plugin code.

As a quick hack, I added a function to ckarma.php:

function get_cmt_karma($id) {
	global $ckarma;
	$karma = $ckarma-&#62;getKarma($id);
	return $karma;
}

that I then call in my comments (foreach) loop right at the top:

$karma = get_cmt_karma(get_comment_id());
if ($karma &#60; -9) continue; 

So we skip over "buried" comments with ratings of -10 or less; set your own threshold here.

Then you can also use this as a qualifier when writing the comment header info to turn off e.g. a DoFollow link for a spammy comment.

Anyway, hope someone finds this useful, I would still be interested if there was some sort of implementation of the "bury" that I overlooked.

I too am working on a way to get the top comment for a post, easiest would likely be to add a field ck_post_id to the table and save this on "insert". Else it's going to have to be a pretty messy (and slower) join of the wp_comments and wp_ckTbl_ tables.

Thanks for the great plugin.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I was wondering how the &#8220;bury&#8221; is actually implemented, since I couldn&#8217;t find anything about it in your plugin code.</p>
<p>As a quick hack, I added a function to ckarma.php:</p>
<p>function get_cmt_karma($id) {<br />
	global $ckarma;<br />
	$karma = $ckarma-&gt;getKarma($id);<br />
	return $karma;<br />
}</p>
<p>that I then call in my comments (foreach) loop right at the top:</p>
<p>$karma = get_cmt_karma(get_comment_id());<br />
if ($karma &lt; -9) continue; </p>
<p>So we skip over &#8220;buried&#8221; comments with ratings of -10 or less; set your own threshold here.</p>
<p>Then you can also use this as a qualifier when writing the comment header info to turn off e.g. a DoFollow link for a spammy comment.</p>
<p>Anyway, hope someone finds this useful, I would still be interested if there was some sort of implementation of the &#8220;bury&#8221; that I overlooked.</p>
<p>I too am working on a way to get the top comment for a post, easiest would likely be to add a field ck_post_id to the table and save this on &#8220;insert&#8221;. Else it&#8217;s going to have to be a pretty messy (and slower) join of the wp_comments and wp_ckTbl_ tables.</p>
<p>Thanks for the great plugin.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EERac</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69843</link>
		<dc:creator>EERac</dc:creator>
		<pubDate>Sat, 10 May 2008 00:47:26 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69843</guid>
		<description>Oh, also the ck_comment_id column should be indexed, it makes queries much faster when wordpress is displaying a comments rating.</description>
		<content:encoded><![CDATA[<p>Oh, also the ck_comment_id column should be indexed, it makes queries much faster when wordpress is displaying a comments rating.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EERac</title>
		<link>http://www.cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69842</link>
		<dc:creator>EERac</dc:creator>
		<pubDate>Sat, 10 May 2008 00:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://cyber-knowledge.net/blog/2006/10/15/wordpress-plugin-rate-your-comments-comment-karma/#comment-69842</guid>
		<description>I run a site that gets a lot of comments. The performance of this plugin was greatly improved when the database columns ck_rating and ck_comment_id in table wp_ck_karma were changed to integers from strings.

Specifically, when the plugin installs, it creates these columns in the MYSQL database as containing type VARCHAR. I changed them to INT and BIGINT respectively. It'd probably be a good idea if the plugin author changed this bit of code. Otherwise the plugin works great, thanks Alex!</description>
		<content:encoded><![CDATA[<p>I run a site that gets a lot of comments. The performance of this plugin was greatly improved when the database columns ck_rating and ck_comment_id in table wp_ck_karma were changed to integers from strings.</p>
<p>Specifically, when the plugin installs, it creates these columns in the MYSQL database as containing type VARCHAR. I changed them to INT and BIGINT respectively. It&#8217;d probably be a good idea if the plugin author changed this bit of code. Otherwise the plugin works great, thanks Alex!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
