die('Please do not load this page directly. Thanks!');
if(!empty($post->post_password)){// if there's a password
if($_COOKIE['wp-postpass_'.COOKIEHASH]!=$post->post_password){// and it doesn't match the cookie
?>
<pclass="nocomments"><?php_e("This post is password protected. Enter the password to view comments.");?><p>
<?php
return;
}
}
/* This variable is for alternating comment background */
$oddcomment='alt';
?>
<!-- You can start editing here. -->
<?phpif($comments):?>
<h3id="comments"><?phpcomments_number('No Responses','One Response','% Responses');?> to “<?phpthe_title();?>”</h3>
<olclass="commentlist">
<?php$commentcounter=0;?>
<?phpforeach($commentsas$comment):?>
<?php$commentcounter++;?>
<liclass="<?phpecho$oddcomment;?>">
<pclass="cmtinfo"id="comment-<?phpcomment_ID()?>"><em>on <?phpcomment_date('d M Y')?> at <?phpcomment_time()?><ahref="#comment-<?phpcomment_ID()?>"title=""></a><?phpedit_comment_link('edit','','');?></em><cite><spanclass="commentnum"><?phpecho$commentcounter;?>.</span><?phpcomment_author_link()?></cite> said …</p>
<?phpif($comment->comment_approved=='0'):?>
<em>Your comment is awaiting moderation.</em>
<br/>
<?phpendif;?>
<p><?phpcomment_text()?></p>
</li>
<?php/* Changes every other comment to a different class */
if('alt'==$oddcomment)$oddcomment='';
else$oddcomment='alt';
?>
<?phpendforeach;/* end for each comment */?>
</ol>
<?phpelse:// this is displayed if there are no comments so far ?>
<?phpif('open'==$post->comment_status):?>
<!-- If comments are open, but there are no comments. -->
<?phpelse:// comments are closed ?>
<!--Ifcommentsareclosed.-->
<pclass="nocomments">Commentsareclosed.</p>
<?phpendif;?>
<?phpendif;?>
<divclass="post-content">
<p>
<?phpif($post->ping_status=="open"){?>
<ahref="<?phptrackback_url(display);?>">Trackback This Post</a> |
<?php}?>
<?phpif($post->comment_status=="open"){?>
<?phpcomments_rss_link('Subscribe to the comments through RSS Feed');?>
<p>Logged in as <ahref="<?phpechoget_option('siteurl');?>/wp-admin/profile.php"><?phpecho$user_identity;?></a>. <ahref="<?phpechoget_option('siteurl');?>/wp-login.php?action=logout"title="<?php_e('Log out of this account')?>">Logout »</a></p>
$request="SELECT ID, comment_ID, comment_content, comment_author FROM $tableposts, $tablecomments WHERE $tableposts.ID=$tablecomments.comment_post_ID AND post_status = 'publish' ";
$request.="AND comment_approved = '1' ORDER BY $tablecomments.comment_date DESC LIMIT $no_comments";
<ul><liid="about"><?phpbloginfo('description');?><p>There are <?phpglobal$numposts;echo$numposts;?> posts and <?phpglobal$numcmnts;echo$numcmnts;?> comments so far.</p></li></ul>