diff --git a/b2commentspopup.php b/b2commentspopup.php index 1308f3d90a..6d784f0360 100644 --- a/b2commentspopup.php +++ b/b2commentspopup.php @@ -21,16 +21,15 @@ foreach ($posts as $post) { start_b2();

Comments

    - get_results("SELECT * FROM $tablecomments WHERE comment_post_ID = $id ORDER BY comment_date"); $commentstatus = $wpdb->get_row("SELECT comment_status, post_password FROM $tableposts WHERE ID = $id"); +if (!empty($commentstatus->post_password) && $HTTP_COOKIE_VARS['wp-postpass'] != $commentstatus->post_password) { // and it doesn't match the cookie + echo("
  1. ".get_the_password_form()."
"); +} +else { + if ($comments) { // this line is WordPress' motor, do not delete it. -if ($comments) { - 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) { ?> @@ -39,19 +38,15 @@ if ($comments) {

    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) { ?> + if ('open' == $commentstatus->comment_status) { ?>

    Leave a Comment

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

    @@ -86,7 +81,9 @@ else if ('open' == $commentstatus->comment_status) { ?>

    Sorry, comments are closed at this time.

    - +
    Close this window.