Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div id="comments-block">
- <?php
- // Do not delete these lines
- if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
- die ('Please do not load this page directly. Thanks!');
- if ( post_password_required() ) { ?>
- <p class="nocomments">This post is password protected. Enter the password to view comments.</p>
- <?php
- return;
- }
- ?>
- <!-- You can start editing here. -->
- <?php if ( have_comments() ) :
- $comments_count = separate_comments(get_comments('post_id='. get_the_ID()));
- $comment_count = count($comments_count['comment']);
- if($comment_count==0) {
- $cc_display='No Comments';
- } else if($comment_count==1) {
- $cc_display='1 Comment';
- } else {
- $cc_display="$comment_count Comments";
- }
- ?>
- <div class="comment-info"><?php echo $cc_display; ?> to “<?php the_title(); ?>”</div>
- <ol class="comments-list">
- <?php wp_list_comments('type=comment&callback=hype_comment'); ?>
- </ol>
- <div class="comment-nav hype-btn">
- <div class="comment-nav-left"><?php previous_comments_link() ?></div>
- <div class="comment-nav-right"><?php next_comments_link() ?></div>
- </div>
- <?php if ('closed' == $post->comment_status) : ?>
- <p class="nocomments">Comments are closed.</p>
- <?php endif; ?>
- <?php else : // this is displayed if there are no comments so far ?>
- <?php if ('open' == $post->comment_status) : ?>
- <!-- If comments are open, but there are no comments. -->
- <?php else : // comments are closed ?>
- <?php if (is_single()) : ?>
- <!-- If comments are closed. -->
- <p class="nocomments">Comments are closed.</p>
- <?php endif; ?>
- <?php endif; ?>
- <?php endif; ?>
- <?php if ('open' == $post->comment_status) : ?>
- <div id="respond">
- <h3><?php comment_form_title( 'Leave a Comment', 'Leave a Reply to %s' ); ?></h3>
- <div class="cancel-comment-reply">
- <small><?php cancel_comment_reply_link(); ?></small>
- </div>
- <?php if ( get_option('comment_registration') && !$user_ID ) : ?>
- <p>You must be <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?redirect_to=<?php echo urlencode(get_permalink()); ?>">logged in</a> to post a comment.</p>
- <?php else : ?>
- <form action="<?php echo get_option('siteurl'); ?>/wp-comments-post.php" method="post" id="commentform">
- <?php if ( $user_ID ) : ?>
- <div class="comment-author vcard leave-comment-author">
- <div class="comment-avatar"><?php echo get_avatar(get_the_author_meta('user_email'), $size = '64'); ?></div><div class="comment-author-name-reply comment-text"> Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo wp_logout_url(get_permalink()); ?>" title="Log out of this account" class="logout-btn">Log out »</a></div></div>
- <?php else : ?>
- <p><label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label><input type="text" name="author" id="author" value="<?php echo $comment_author; ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
- </p>
- <p><label for="email"><small>E-Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label><input type="text" name="email" id="email" value="<?php echo $comment_author_email; ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
- </p>
- <p><label for="url"><small>Website</small></label><input type="text" name="url" id="url" value="<?php echo $comment_author_url; ?>" size="22" tabindex="3" />
- </p>
- <?php endif; ?>
- <div class="comment-textarea">
- <p><textarea name="comment" id="comment" cols="50" rows="10" tabindex="4"></textarea></p>
- <p><input name="submit" type="submit" id="submit" tabindex="5" value="Submit Comment" />
- <?php comment_id_fields(); ?>
- </p>
- <?php do_action('comment_form', $post->ID); ?>
- <p style="text-align:left;font-size:0.9em;color:#999;">You can use these tags: <code><?php echo allowed_tags(); ?></code></p>
- </div>
- </form>
- <?php endif; // If registration required and not logged in ?>
- </div>
- <div id="comment-trackbacks">
- <div id="tb-header" class="clearfix">
- <?php
- $trackback_count = count($comments_count['trackback']);
- $pingback_count = count($comments_count['pingback']);
- if(($trackback_count!=0) || ($pingback_count!=0)) {
- $tb_title = "<h4>";
- if($trackback_count!=0){
- $tb_title .= "$trackback_count Trackbacks";
- }
- if(($trackback_count!=0) && ($pingback_count!=0)) {
- $tb_title .= " / ";
- }
- if($pingback_count!=0){
- $tb_title .= "$pingback_count Pingbacks";
- }
- $tb_title .= "</h4>";
- } else {
- $tb_title = ' ';
- }
- ?>
- <div id="tb-title">
- <?php echo $tb_title; ?>
- </div>
- <div id="tb-url"><a href="<?php trackback_url(); ?>">Get a Trackback Link</a></div>
- </div>
- <div id="tb-list">
- <?php
- if(($trackback_count!=0) || ($pingback_count!=0)) {
- ?>
- <ol class="comments-trackback-list">
- <?php
- foreach($comments_count['pings'] as $tb) {
- $tb_content = strip_tags($tb->comment_content);
- $tb_url = $tb->comment_author_url;
- $tb_author = $tb->comment_author;
- $tb_date = strtotime($tb->comment_date);
- $tb_date = date('F j, Y \a\t H:i:s',$tb_date);
- $tb_type = $tb->comment_type;
- ?>
- <li <?php comment_class(); ?> id="li-trackback-<?php comment_ID() ?>"><span class="comment-tb-date"><?php echo $tb_date; ?></span><br /> <span class="tb-type"><?php echo $tb_type ?>:</span> <span class="tb-author"><a href="<?php echo $tb_url ?>" target="_blank"><?php echo $tb_author; ?></a></span> - <span class="comment-tb-content"><?php echo $tb_content; ?></span></li>
- <?php
- }
- ?>
- </ol>
- <?php
- } ?>
- </div>
- </div>
- <?php endif; // if you delete this the sky will fall on your head ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement