<?php
 
if ('comments.php'== basename($_SERVER['SCRIPT_FILENAME']))
die ('Please do not load this page directly. Thanks!');
if (!empty($post->post_password)) {
if ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) {
;echo '			<p class="nocomments">必须输入密码，才能查看评论！</p>
			';
return;
}
}
$oddcomment = '';
;echo '<!-- You can start editing here. -->
';if ($comments) : ;echo '	<div class="com" id="comments">';the_title();;echo '：目前有';comments_number('','1 条留言','% 条留言');;echo '</div>
	<ol class="commentlist">
	';wp_list_comments('type=comment&callback=weisay_comment&end-callback=weisay_end_comment&max_depth=23');;echo '	</ol>
	<div class="navigation">
		<div class="pagination">';paginate_comments_links();;echo '</div>
	</div>
 ';else : 
;echo '	';if ('open'== $post->comment_status) : ;echo '		<!-- If comments are open, but there are no comments. -->
		<div class="com" id="comments">';the_title();;echo '：等您坐沙发呢！</div>
	 ';else : 
;echo '		<!-- If comments are closed. -->
		<p class="nocomments">报歉!评论已关闭.</p>
	';endif;;echo '	';endif;;echo '	';if ('open'== $post->comment_status) : ;echo '	<div id="respond_box">
	<div id="respond">
		<h3>发表评论</h3>	
		<div class="cancel-comment-reply">
		<div id="real-avatar">';echo get_avatar( $comment,40 );;echo '</div>	
			<small>';cancel_comment_reply_link();;echo '</small>
		</div>
		';if ( get_option('comment_registration') &&!$user_ID ) : ;echo '		<p>';print '您必须';;echo '<a href="';echo get_option('siteurl');;echo '/wp-login.php?redirect_to=';echo urlencode(get_permalink());;echo '"> [ 登录 ] </a>才能发表留言！</p>
    ';else : ;echo '    <form action="';echo get_option('siteurl');;echo '/wp-comments-post.php" method="post" id="commentform">
      ';if ( $user_ID ) : ;echo '      <p>';print '登录者：';;echo ' <a href="';echo get_option('siteurl');;echo '/wp-admin/profile.php">';echo $user_identity;;echo '</a>&nbsp;&nbsp;<a href="';echo wp_logout_url(get_permalink());;echo '" title="退出">';print '[ 退出 ]';;echo '</a></p>
	';elseif ( ''!= $comment_author ): ;echo '	<div class="author">';printf(__('欢迎回来 <strong>%s</strong>'),$comment_author);;echo '			<a href="javascript:toggleCommentAuthorInfo();" id="toggle-comment-author-info">[ 更改 ]</a></div>
			<script type="text/javascript" charset="utf-8">
				//<![CDATA[
				var changeMsg = "[ 更改 ]";
				var closeMsg = "[ 隐藏 ]";
				function toggleCommentAuthorInfo() {
					jQuery(\'#comment-author-info\').slideToggle(\'slow\', function(){
						if ( jQuery(\'#comment-author-info\').css(\'display\') == \'none\' ) {
						jQuery(\'#toggle-comment-author-info\').text(changeMsg);
						} else {
						jQuery(\'#toggle-comment-author-info\').text(closeMsg);
				}
			});
		}
				jQuery(document).ready(function(){
					jQuery(\'#comment-author-info\').hide();
				});
				//]]>
			</script>
	';endif;;echo '	';if ( !$user_ID ): ;echo '	<div id="comment-author-info">
		<p>
			<input type="text" name="author" id="author" class="commenttext" value="';echo $comment_author;;echo '" size="22" tabindex="1" />
			<label for="author">昵称';if ($req) echo ' *';;echo '</label>
		</p>
		<p>
			<input type="text" name="email" id="email" class="commenttext" value="';echo $comment_author_email;;echo '" size="22" tabindex="2" />
			<label for="email">邮箱';if ($req) echo ' *';;echo '</label>
		</p>
		<p>
			<input type="text" name="url" id="url" class="commenttext" value="';echo $comment_author_url;;echo '" size="22" tabindex="3" />
			<label for="url">网址</label>
		</p>
	</div>
      ';endif;;echo '		<!--<p><small><strong>XHTML:</strong> You can use these tags: <code>';echo allowed_tags();;echo '</code></small></p>-->
      <div class="clear"></div>
      <p>';wp_smilies();;echo '</p>
		<p><textarea name="comment" id="comment" tabindex="4" cols="50" rows="5"></textarea></p>
		<p>
			<input class="submit" name="submit" type="submit" id="submit" tabindex="5" value="提交留言" />
			<input class="reset" name="reset" type="reset" id="reset" tabindex="6" value="';esc_attr_e( '重写');;echo '" />
			';comment_id_fields();;echo '		</p>
		<script type="text/javascript">	//Crel+Enter
		//<![CDATA[
			jQuery(document).keypress(function(e){
				if(e.ctrlKey && e.which == 13 || e.which == 10) { 
					jQuery(".submit").click();
					document.body.focus();
				} else if (e.shiftKey && e.which==13 || e.which == 10) {
					jQuery(".submit").click();
				}          
			})
		// ]]>
		</script>
		';do_action('comment_form',$post->ID);;echo '		<span style="padding:0 0 2px 8px">快捷键：Ctrl+Enter</span>
    </form>
	<div class="clear"></div>
    ';endif;
;echo '  </div>
  </div>
  ';endif;
?>