Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 98 lines (78 sloc) 4.916 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
<?php
    // this is drop-in replacement for Sandbox's comments.php. This supports comment threading and pagination.
    // http://alicebob.cryptoland.net/sandbox-wordpress-theme-for-27-with-threaded-comments/
?>
<?php
if ( 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']) )
die ( 'Please do not load this page directly. Thanks.' );
?>
<div id="comments">
<?php
if ( post_password_required() ) :
?>
<div class="nopassword"><?php _e( 'This post is protected. Enter the password to view any comments.', 'sandbox' ) ?></div>
</div><!-- .comments -->
<?php
return;
endif;
?>
<?php if ( have_comments() ) : ?>
<div id="comments-list" class="comments">
<?php calpress_update_comment_count();//exlude ping and trackback in comment count ?>
<h3><?php comments_number('', __('<span>One</span> Comment', 'sandbox'), __('<span>%</span> Comments', 'sandbox') ); ?></h3>
<div id="comments-nav-above" class="comments-navigation">
<?php paginate_comments_links($args); ?>
</div>
<ol class="commentlist">
<?php //wp_list_comments(); ?>
<?php
    // get threaded comments.
    wp_list_comments('type=comment&callback=calpress_custom_comments');
?>
</ol>
<div id="comments-nav-below" class="comments-navigation">
<?php paginate_comments_links($args); ?>
</div>
</div><!-- #comments-list .comments -->
<?php endif // REFERENCE: if ( have_comments() ) ?>
<?php if ( comments_open() ) : ?>
<?php $req = get_option('require_name_email'); // Checks if fields are required. Thanks, Adam. ;-) ?>

<div id="respond">
<h3><?php comment_form_title( __( 'Post a Comment', 'sandbox' ), __( 'Post a Reply to %s', 'sandbox' ) ); ?></h3>

<div id="cancel-comment-reply"><?php cancel_comment_reply_link() ?></div>

<?php if ( get_option('comment_registration') && !$user_ID ) : ?>
<p id="login-req"><?php printf(__('You must be <a href="%s" title="Log in">logged in</a> to post a comment.', 'sandbox'),
wp_logout_url(get_permalink()) ) ?></p>

<?php else : ?>
<div class="formcontainer">
<form id="commentform" action="<?php bloginfo('wpurl') ?>/wp-comments-post.php" method="post">

<?php if ( $user_ID ) : ?>
<p id="login"><?php printf( __( '<span class="loggedin">Logged in as <a href="%1$s" title="Logged in as %2$s">%2$s</a>.</span> <span class="logout"><a href="%3$s" title="Log out of this account">Log out?</a></span>', 'sandbox' ),
get_bloginfo('wpurl') . '/wp-admin/profile.php',
wp_specialchars( $user_identity, 1 ),
get_bloginfo('wpurl') . '/wp-login.php?action=logout&amp;redirect_to=' . get_permalink() ) ?></p>
<?php calpress_hook_comment_message(); ?>

<?php else : ?>

<?php calpress_hook_comment_message(); ?>

<div id="comment-user-details">
<?php do_action('alt_comment_login'); ?>
<div class="form-label"><label for="author"><?php _e( 'Name', 'sandbox' ) ?></label> <?php if ($req) _e( '<span class="required">*</span>', 'sandbox' ) ?></div>
<div class="form-input"><input id="author" name="author" class="text<?php if ($req) echo ' required'; ?>" type="text" value="<?php echo $comment_author ?>" size="30" maxlength="50" tabindex="3" /></div>

<div class="form-label"><label for="email"><?php _e( 'Email', 'sandbox' ) ?></label> <?php if ($req) _e( '<span class="required">*</span>', 'sandbox' ) ?></div>
<div class="form-input"><input id="email" name="email" class="text<?php if ($req) echo ' required'; ?>" type="text" value="<?php echo $comment_author_email ?>" size="30" maxlength="50" tabindex="4" /></div>

<div class="form-label"><label for="url"><?php _e( 'Website', 'sandbox' ) ?></label></div>
<div class="form-input"><input id="url" name="url" class="text" type="text" value="<?php echo $comment_author_url ?>" size="30" maxlength="50" tabindex="5" /></div>
</div>

<?php endif // REFERENCE: * if ( $user_ID ) ?>

<div class="form-label"><label for="comment"><?php _e( 'Comment', 'sandbox' ) ?></label></div>
<div class="form-textarea"><textarea id="comment" name="comment" class="text required" cols="45" rows="8" tabindex="6"></textarea></div>

<div class="form-submit"><input id="submit" name="submit" class="button" type="submit" value="<?php _e( 'Post Comment', 'sandbox' ) ?>" tabindex="7" />
<?php comment_id_fields(); ?>
</div>

<div class="form-option"><?php do_action( 'comment_form', $post->ID ) ?></div>

</form><!-- #commentform -->
</div><!-- .formcontainer -->
<?php endif // REFERENCE: if ( get_option('comment_registration') && !$user_ID ) ?>

</div><!-- #respond -->
<?php endif // REFERENCE: if ( 'open' == $post->comment_status ) ?>

</div><!-- #comments -->
Something went wrong with that request. Please try again.