--- ../tb/tweetbacks/tweetbacks.php 2009-01-11 21:22:06.000000000 +0000
+++ ../tweetbacks/tweetbacks.php 2009-01-12 17:18:07.000000000 +0000
@@ -93,6 +93,14 @@
} else {
$options['filterretweets'] = false;
}
+
+
+ if (isset($_POST['autoapprovetweets'])) {
+ $options['autoapprovetweets'] = true;
+ } else {
+ $options['autoapprovetweets'] = false;
+ }
+
update_option("tweetbacks",$options);
}
@@ -141,6 +149,17 @@
id="filterretweets"/>
+
+
+ |
+
+
+ If checked, all tweets will be automatically approved. This could lead to spam on your blog
+ |
+ id="autoapprovetweets"/>
+ |
+
+
@@ -345,9 +364,14 @@
$pattern = '/\@([a-zA-Z0-9]+)/';
$replace = '@\1';
$commentdata['comment_content'] = preg_replace($pattern,$replace,$commentdata['comment_content']);
-
+
+ if (isset($options['autoapprovetweets']) && $options['autoapprovetweets'] == true)
+ $commentdata['comment_approved'] = '1';
+ else
+ $commentdata['comment_approved'] = '0';
+
$commentdata['comment_type'] = "tweetback";
- $commentdata['comment_date'] = gmdate("Y-m-d H:i:s",strtotime($r['published']));
+ $commentdata['comment_date'] = gmdate("Y-m-d H:i:s", strtotime($r['published']));
if ($commentdata['comment_content'] != "") {
// Make sure we don't store twitter comments twice.
@@ -497,4 +521,4 @@
}
add_action('shutdown','yoast_get_tweetbacks',10,1);
-?>
\ No newline at end of file
+?>