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