From 89398924614d8457e10e658911f35e39034c655d Mon Sep 17 00:00:00 2001 From: alex_t_king Date: Sat, 27 Sep 2003 05:45:29 +0000 Subject: [PATCH] added check for password protection git-svn-id: http://svn.automattic.com/wordpress/trunk@390 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- b2commentspopup.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) 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:

    -