Post details: I have made trackbacks moderated

03/07/06

Permalink 11:11:02 am, Categories: b2evolution, Patches, 249 words   English (US)

I have made trackbacks moderated

I have made trackbacks in this weblog moderated.

[More:]

I did it with the b2evolution patch presented below.

However, in addition to this patch are needed changes in b2evolution which would allow to easily publish draft trackbacks. Sorry, now I will keep that changes private (not publish them) because these are draft. If you desire you can edit evo_comments database table directly to make trackbacks published (or delete SPAM trackbacks).

Very well then the authors of b2evolution itself could do it themselves (my help is not really needed for them to do it. Just let you do it if you are an author of b2evolution).

This patch can be applied to b2evolution 0.9.1.

diff --exclude=*~ --exclude=*.b[ac]k -bBNaur blogs.old/htsrv/trackback.php blogs/htsrv/trackback.php
--- blogs.old/htsrv/trackback.php       Tue Sep 13 16:11:02 2005
+++ blogs/htsrv/trackback.php   Tue Mar  7 22:52:32 2006
@@ -85,10 +85,10 @@

$query = "INSERT INTO $tablecomments( comment_post_ID, comment_type, comment_author,
comment_author_email, comment_author_url, comment_author_IP,
-                                                                                                                     comment_date, comment_content)
+                                                                                                                     comment_date, comment_content, comment_status)
VALUES( $comment_post_ID, 'trackback', '".$DB->escape($comment_author)."',
'".$DB->escape($comment_author_email)."', '".$DB->escape($comment_author_url)."', '".$DB->escape($user_ip)."',
-                                                                               '$now', '".$DB->escape($comment)."' )";+                                                                               '$now', '".$DB->escape($comment)."', 'draft' )";
if( !$DB->query( $query ) )
{
trackback_response(2, "There is an error with the database, it can't store your comment...<br />Contact the <a href=\"mailto:$admin_email\">webmaster</a>");   // TODO: check that error code 2 is ok

Comments, Trackbacks, Pingbacks:

No Comments/Trackbacks/Pingbacks for this post yet...

Software Blog

See also my free software. This weblog will contain information about:
  • software developed by me;
  • my software patches (for others' software);
  • my software related reviews, comments, suggestions, ideas
and other misc software related things.

Recently ||

Last comments

Search

Syndicate this blog XML

Add to MyYahoo

What is RSS?

powered by
b2evolution