diff --git a/b2commentspopup.php b/b2commentspopup.php index c4cfa9f009..1308f3d90a 100644 --- a/b2commentspopup.php +++ b/b2commentspopup.php @@ -24,29 +24,37 @@ foreach ($posts as $post) { start_b2(); get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"); -$commentstatus = $wpdb->get_var("SELECT comment_status FROM $tableposts WHERE ID = $id"); +$commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id"); // this line is WordPress' motor, do not delete it. if ($comments) { - foreach ($comments as $comment) { + if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass'] != $commentstatus->post_password) { // and it doesn't match the cookie + echo("
  • Enter your password to view comments.
  • "); + } + else { + foreach ($comments as $comment) { ?> -
  • by @

  • -
  • No comments yet.
  • +post_password) && $HTTP_COOKIE_VARS['wp-postpass'] != $commentstatus->post_password) { +// no authorization for private comments +} +else if ('open' == $commentstatus->comment_status) { ?>

    Leave a Comment

    -

    Line and paragraph breaks automatic, website trumps email, HTML allowed:

    -