| 1 | <?php // Do not delete these lines |
|---|
| 2 | if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME'])) |
|---|
| 3 | die ('Please do not load this page directly. Thanks!'); |
|---|
| 4 | |
|---|
| 5 | if (!empty($post->post_password)) { // if there's a password |
|---|
| 6 | if ($_COOKIE['wp-postpass_' . COOKIEHASH] != $post->post_password) { // and it doesn't match the cookie |
|---|
| 7 | ?> |
|---|
| 8 | |
|---|
| 9 | <p class="nocomments"><?php _e( 'This post is password protected. Enter the password to view comments.' ) ?></p> |
|---|
| 10 | |
|---|
| 11 | <?php |
|---|
| 12 | return; |
|---|
| 13 | } |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | /* This variable is for alternating comment background */ |
|---|
| 17 | $oddcomment = 'class="alt" '; |
|---|
| 18 | ?> |
|---|
| 19 | |
|---|
| 20 | <!-- You can start editing here. --> |
|---|
| 21 | |
|---|
| 22 | <div id="comments-section"> |
|---|
| 23 | <?php if ($comments) : ?> |
|---|
| 24 | <h3 id="responses"><?php comments_number( __( 'No Responses', 'buddypress' ), __( 'One Response', 'buddypress' ), __( '% Responses', 'buddypress' ) );?> <?php _e( 'to', 'buddypress' ) ?> “<?php the_title(); ?>”</h3> |
|---|
| 25 | |
|---|
| 26 | <ol class="commentlist" id="comments"> |
|---|
| 27 | |
|---|
| 28 | <?php foreach ($comments as $comment) : ?> |
|---|
| 29 | |
|---|
| 30 | <li <?php echo $oddcomment; ?>id="comment-<?php comment_ID() ?>"> |
|---|
| 31 | <div class="comment-details"> |
|---|
| 32 | <?php bp_comment_author_avatar() ?> |
|---|
| 33 | <p><?php comment_author_link() ?> <?php _e( 'said:', 'buddypress' ) ?></p> |
|---|
| 34 | </div> |
|---|
| 35 | |
|---|
| 36 | <div class="comment-content"> |
|---|
| 37 | <?php if ($comment->comment_approved == '0') : ?> |
|---|
| 38 | <p><strong><?php _e( 'Your comment is awaiting moderation.', 'buddypress' ) ?></strong></p> |
|---|
| 39 | <?php endif; ?> |
|---|
| 40 | <?php comment_text() ?> |
|---|
| 41 | |
|---|
| 42 | <p class="commentmetadata"><a href="#comment-<?php comment_ID() ?>" title=""><?php comment_date('F jS, Y') ?> <?php _e( 'at', 'buddypress' ) ?> <?php comment_time() ?></a> <?php edit_comment_link('Edit',' [ ',' ]'); ?></p> |
|---|
| 43 | </div> |
|---|
| 44 | <div class="clear"></div> |
|---|
| 45 | </li> |
|---|
| 46 | |
|---|
| 47 | <?php |
|---|
| 48 | /* Changes every other comment to a different class */ |
|---|
| 49 | $oddcomment = ( empty( $oddcomment ) ) ? 'class="alt" ' : ''; |
|---|
| 50 | ?> |
|---|
| 51 | |
|---|
| 52 | <?php endforeach; /* end for each comment */ ?> |
|---|
| 53 | |
|---|
| 54 | </ol> |
|---|
| 55 | <?php else : // this is displayed if there are no comments so far ?> |
|---|
| 56 | |
|---|
| 57 | <?php if ('open' == $post->comment_status) : ?> |
|---|
| 58 | <!-- If comments are open, but there are no comments. --> |
|---|
| 59 | |
|---|
| 60 | <?php else : // comments are closed ?> |
|---|
| 61 | <!-- If comments are closed. --> |
|---|
| 62 | <p class="nocomments"><?php _e( 'Comments are closed.', 'buddypress' ) ?></p> |
|---|
| 63 | <?php endif; ?> |
|---|
| 64 | |
|---|
| 65 | <?php endif; ?> |
|---|
| 66 | </div> |
|---|
| 67 | <?php if ( $user_ID ) : ?> |
|---|
| 68 | </div> |
|---|
| 69 | <?php endif; ?> |
|---|
| 70 | |
|---|
| 71 | |
|---|
| 72 | <div id="compose-reply"> |
|---|
| 73 | <?php if ('open' == $post->comment_status) : ?> |
|---|
| 74 | |
|---|
| 75 | <h3 id="respond"><?php _e( 'Leave a Reply', 'buddypress' ) ?></h3> |
|---|
| 76 | |
|---|
| 77 | <?php if ( get_option('comment_registration') && !$user_ID ) : ?> |
|---|
| 78 | <p><?php printf( __( 'You must be <a href="%s">logged in</a> to post a comment.', 'buddypress' ), get_option('siteurl') . '/wp-login.php?redirect_to=' . urlencode(get_permalink()) ) ?></p> |
|---|
| 79 | <?php else : ?> |
|---|
| 80 | |
|---|
| 81 | <form action="<?php echo site_url(); ?>/wp-comments-post.php" method="post" id="commentform"> |
|---|
| 82 | |
|---|
| 83 | <?php if ( $user_ID ) : ?> |
|---|
| 84 | |
|---|
| 85 | <p><?php _e( 'Logged in as', 'buddypress' ) ?> <a href="<?php echo site_url(); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo site_url(); ?>/wp-login.php?action=logout" title="Log out of this account"><?php _e( 'Logout', 'buddypress' ) ?> »</a></p> |
|---|
| 86 | |
|---|
| 87 | <?php else : ?> |
|---|
| 88 | |
|---|
| 89 | <p><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" /> |
|---|
| 90 | <label for="author"><?php _e( 'Name', 'buddypress' ) ?> <?php if ($req) _e( '(required)', 'buddypress' ); ?></label></p> |
|---|
| 91 | |
|---|
| 92 | <p><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" /> |
|---|
| 93 | <label for="email"><?php _e( 'Mail (will not be published)', 'buddypress' ) ?> <?php if ($req) _e( '(required)', 'buddypress' ); ?></label></p> |
|---|
| 94 | |
|---|
| 95 | <p><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" /> |
|---|
| 96 | <label for="url"><?php _e( 'Website', 'buddypress' ) ?></label></p> |
|---|
| 97 | |
|---|
| 98 | <?php endif; ?> |
|---|
| 99 | |
|---|
| 100 | <p><textarea name="comment" id="comment" cols="38" rows="10" tabindex="4"></textarea></p> |
|---|
| 101 | |
|---|
| 102 | <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php _e ( 'Submit Comment', 'buddypress' ) ?>" /> |
|---|
| 103 | <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" /> |
|---|
| 104 | </p> |
|---|
| 105 | <?php do_action('comment_form', $post->ID); ?> |
|---|
| 106 | |
|---|
| 107 | </form> |
|---|
| 108 | <?php endif; // If registration required and not logged in ?> |
|---|
| 109 | </div> |
|---|
| 110 | |
|---|
| 111 | <?php endif; // if you delete this the sky will fall on your head ?> |
|---|
| 112 | |
|---|