Elliott C. Back: Technology FTW!

Today’s Wordpress Question #1

Posted in Blogging by Elliott Back on April 15th, 2005.

So, random people email me with Wordpress support questions. Here’s the first I got today, and the solution:

Hi Elliott - I landed on your blog through a search on how to implement WordPress patches. I think my question is much too simple for the techies in the forum because no one seems to understand it.

Because of comment moderation issues, I’m trying to fix with the patch pasted below. I have no idea where to paste in the commen-functions.php file. I understand that the sumber 725 is the line in the code, but what’s with the negative sign in front of it and the 8 behind it and the positive 725, etc?

This isn’t a complicated question, is it? Nobody will tell me what to do. I’d appreciate if you explained it to me. I’d be very grateful. :)

— wordpress/comment-functions.php Tue Jan 11
23:41:18 2005
+++ wptest/comment-functions.php Tue Jan 11 23:38:54
2005
@@ -725,8 +725,11 @@
if ( 1 == get_settings(’comment_whitelist’)) {
if( $author != ” && $email != ” ) {
$ok_to_comment = $wpdb->get_var(”SELECT
comment_approved FROM $wpdb->comments WHERE
comment_author = ‘$author’ AND comment_author_email =
‘$email’ and comment_approved = ‘1′ “);
- if ( 1 == $ok_to_comment && false === strpos(
$email, get_settings(’moderation_keys’)) )
+ if ( 1 == $ok_to_comment && false === strpos(
$email, get_settings(’moderation_keys’)) ) {
return true;
+ } else {
+ return false;
+ }
}
if ( ‘trackback’ == $comment_type || ‘pingback’ ==
$comment_type ) { // check if domain is in blogroll
$uri = parse_url($url);
@@ -764,4 +767,4 @@
return true;
}

-?>
No newline at end of file
+?>

This patch is in diff format. When lines marked - are the “old” lines, and the lines marked with + are new lines that you should be inserting into your wp-comments file. To actually apply the patch, use the patch command. For more information about the diff format you’re having trouble reading, see this definition.

This entry was posted on Friday, April 15th, 2005 at 7:06 pm and is tagged with complicated question, strpos, trouble reading, author author, newline, support questions, techies, moderation, parse, wordpress, patches, email, blog, patch command. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback.

 

Trackbacks

(Trackback URL)

close Reblog this comment
blog comments powered by Disqus