I installed Comments preview and it worked quite well. But after I installed Brian's threaded comments and replaced my comments.php with Brian's, "Preview" button dissapeared.
Is there any way to make your Comments Preview compatible with Brian's threaded comments?
1. Add a preview button where you want it (probably before or after the line that starts <input onclick="if(typeof(onAddComment) == 'function') . . .).
A preview button would look like <input type="submit" value="Preview" name="preview" id="preview"/>
2. Edit line 33 that starts out $comments = $wpdb->get_results("SELECT * FROM . . .
Just comment it out.
( // $comments = $wpdb->get_results("SELECT * FROM . . .)
Then edit the plugin file, briansthreadedcomments.php on line 392 so that it looks like the following:
That should make the preview work okay, although the preview won't appear as a threaded comment. I'm sure there's a way to do it, but it would involve some hacking of the threaded comment plugin.
I found another problem. Looks like Comment Preview has some conflicts with Popularity Contest plugin. Whenever I try to post a comment with Comment Preview enabled I get this error:
Fatal error: Call to a member function record_feedback() on a non-object in /home/.derringer/staska/staska.net/wp-content/plugins/popularity-contest.php on line 1525
And the in the address bar I see the url of the post with #comment-1000 at the end. (I have abou 330 comments in total on my blog)
The comment actually gets posted and when I reload the page, I can see it.
This is a bad design on the part of the Popularity Content plugin, in my opinion, because it allows a method to be called without first initializing its class. That's why I think action and filter hooks should be assigned when the class initializes.
At any rate, to get around this bug in PC change line 37 of my plugin like so:
I installed Comments preview and it worked quite well. But after I installed Brian's threaded comments and replaced my comments.php with Brian's, "Preview" button dissapeared.
Is there any way to make your Comments Preview compatible with Brian's threaded comments?
You'll need to edit the
comments.phptemplate:1. Add a preview button where you want it (probably before or after the line that starts
<input onclick="if(typeof(onAddComment) == 'function') . . .).A preview button would look like
<input type="submit" value="Preview" name="preview" id="preview"/>2. Edit line 33 that starts out
$comments = $wpdb->get_results("SELECT * FROM . . .Just comment it out.
(
// $comments = $wpdb->get_results("SELECT * FROM . . .)Then edit the plugin file,
briansthreadedcomments.phpon line 392 so that it looks like the following:print "<input type='hidden' id='comment_reply_ID' name='comment_reply_ID' value='" . (int) $_POST['comment_reply_ID'] . "' />";That should make the preview work okay, although the preview won't appear as a threaded comment. I'm sure there's a way to do it, but it would involve some hacking of the threaded comment plugin.
Thanks for the help.
I found another problem. Looks like Comment Preview has some conflicts with Popularity Contest plugin. Whenever I try to post a comment with Comment Preview enabled I get this error:
Fatal error: Call to a member function record_feedback() on a non-object in /home/.derringer/staska/staska.net/wp-content/plugins/popularity-contest.php on line 1525
And the in the address bar I see the url of the post with #comment-1000 at the end. (I have abou 330 comments in total on my blog)
The comment actually gets posted and when I reload the page, I can see it.
This is a bad design on the part of the Popularity Content plugin, in my opinion, because it allows a method to be called without first initializing its class. That's why I think action and filter hooks should be assigned when the class initializes.
At any rate, to get around this bug in PC change line 37 of my plugin like so:
add_action('init', array(&$this,'init'),500);RSS feed for this topic
Reply
You must log in to post.