[ Index ]

PHP Cross Reference of Wordpress 2.9.1

title

Body

[close]

/wp-content/themes/classic/ -> comments.php (source)

   1  <?php
   2  /**
   3   * @package WordPress
   4   * @subpackage Classic_Theme
   5   */
   6  
   7  if ( post_password_required() ) : ?>
   8  <p><?php _e('Enter your password to view comments.'); ?></p>
   9  <?php return; endif; ?>
  10  
  11  <h2 id="comments"><?php comments_number(__('No Comments'), __('1 Comment'), __('% Comments')); ?>
  12  <?php if ( comments_open() ) : ?>
  13      <a href="#postcomment" title="<?php _e("Leave a comment"); ?>">&raquo;</a>
  14  <?php endif; ?>
  15  </h2>
  16  
  17  <?php if ( have_comments() ) : ?>
  18  <ol id="commentlist">
  19  
  20  <?php foreach ($comments as $comment) : ?>
  21      <li <?php comment_class(); ?> id="comment-<?php comment_ID() ?>">
  22      <?php echo get_avatar( $comment, 32 ); ?>
  23      <?php comment_text() ?>
  24      <p><cite><?php comment_type(_x('Comment', 'noun'), __('Trackback'), __('Pingback')); ?> <?php _e('by'); ?> <?php comment_author_link() ?> &#8212; <?php comment_date() ?> @ <a href="#comment-<?php comment_ID() ?>"><?php comment_time() ?></a></cite> <?php edit_comment_link(__("Edit This"), ' |'); ?></p>
  25      </li>
  26  
  27  <?php endforeach; ?>
  28  
  29  </ol>
  30  
  31  <?php else : // If there are no comments yet ?>
  32      <p><?php _e('No comments yet.'); ?></p>
  33  <?php endif; ?>
  34  
  35  <p><?php post_comments_feed_link(__('<abbr title="Really Simple Syndication">RSS</abbr> feed for comments on this post.')); ?>
  36  <?php if ( pings_open() ) : ?>
  37      <a href="<?php trackback_url() ?>" rel="trackback"><?php _e('TrackBack <abbr title="Universal Resource Locator">URL</abbr>'); ?></a>
  38  <?php endif; ?>
  39  </p>
  40  
  41  <?php if ( comments_open() ) : ?>
  42  <h2 id="postcomment"><?php _e('Leave a comment'); ?></h2>
  43  
  44  <?php if ( get_option('comment_registration') && !is_user_logged_in() ) : ?>
  45  <p><?php printf(__('You must be <a href="%s">logged in</a> to post a comment.'), wp_login_url( get_permalink() ) );?></p>
  46  <?php else : ?>
  47  
  48  <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
  49  
  50  <?php if ( is_user_logged_in() ) : ?>
  51  
  52  <p><?php printf(__('Logged in as %s.'), '<a href="'.get_option('siteurl').'/wp-admin/profile.php">'.$user_identity.'</a>'); ?> <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="<?php _e('Log out of this account') ?>"><?php _e('Log out &raquo;'); ?></a></p>
  53  
  54  <?php else : ?>
  55  
  56  <p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" />
  57  <label for="author"><small><?php _e('Name'); ?> <?php if ($req) _e('(required)'); ?></small></label></p>
  58  
  59  <p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" />
  60  <label for="email"><small><?php _e('Mail (will not be published)');?> <?php if ($req) _e('(required)'); ?></small></label></p>
  61  
  62  <p><input type="text" name="url" id="url" value="<?php echo esc_attr($comment_author_url); ?>" size="22" tabindex="3" />
  63  <label for="url"><small><?php _e('Website'); ?></small></label></p>
  64  
  65  <?php endif; ?>
  66  
  67  <!--<p><small><strong>XHTML:</strong> <?php printf(__('You can use these tags: %s'), allowed_tags()); ?></small></p>-->
  68  
  69  <p><textarea name="comment" id="comment" cols="58" rows="10" tabindex="4"></textarea></p>
  70  
  71  <p><input name="submit" type="submit" id="submit" tabindex="5" value="<?php esc_attr_e('Submit Comment'); ?>" />
  72  <input type="hidden" name="comment_post_ID" value="<?php echo $id; ?>" />
  73  </p>
  74  <?php do_action('comment_form', $post->ID); ?>
  75  
  76  </form>
  77  
  78  <?php endif; // If registration required and not logged in ?>
  79  
  80  <?php else : // Comments are closed ?>
  81  <p><?php _e('Sorry, the comment form is closed at this time.'); ?></p>
  82  <?php endif; ?>


Generated: Fri Jan 8 00:19:48 2010 Cross-referenced by PHPXref 0.7