Move comments include into function.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1398 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
0649831ca7
commit
6728151fd2
|
@ -37,7 +37,7 @@ require('./wp-blog-header.php');
|
|||
|
||||
<div class="post">
|
||||
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link: <?php the_title(); ?>"><?php the_title(); ?></a></h3>
|
||||
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category() ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
|
||||
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> — <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
|
||||
|
||||
<div class="storycontent">
|
||||
<?php the_content(); ?>
|
||||
|
@ -52,9 +52,10 @@ require('./wp-blog-header.php');
|
|||
<?php trackback_rdf(); ?>
|
||||
-->
|
||||
|
||||
<?php include(ABSPATH . 'wp-comments.php'); ?>
|
||||
</div>
|
||||
|
||||
<?php comments_template(); // Get wp-comments.php template ?>
|
||||
|
||||
<?php endforeach; else: ?>
|
||||
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
$comment_author_email = (isset($_COOKIE['comment_author_email_'.$cookiehash])) ? trim($_COOKIE['comment_author_email_'.$cookiehash]) : '';
|
||||
$comment_author_url = (isset($_COOKIE['comment_author_url_'.$cookiehash])) ? trim($_COOKIE['comment_author_url_'.$cookiehash]) : '';
|
||||
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$id' AND comment_approved = '1' ORDER BY comment_date");
|
||||
$comments = $wpdb->get_results("SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date");
|
||||
?>
|
||||
|
||||
<!-- You can start editing here. -->
|
||||
|
@ -32,7 +32,8 @@
|
|||
<?php } ?>
|
||||
|
||||
|
||||
<?php if ($comments) { ?>
|
||||
<?php if ($comments) { ;?>
|
||||
|
||||
<ol id="commentlist">
|
||||
<?php foreach ($comments as $comment) { ?>
|
||||
<li id="comment-<?php comment_ID() ?>">
|
||||
|
|
|
@ -16,6 +16,12 @@ add_filter('comment_text', 'convert_smilies', 20);
|
|||
|
||||
add_filter('comment_excerpt', 'convert_chars');
|
||||
|
||||
function comments_template() {
|
||||
global $withcomments, $single, $post, $wpdb, $id, $comment;
|
||||
if ( $single || $withcomments )
|
||||
include(ABSPATH . 'wp-comments.php');
|
||||
}
|
||||
|
||||
function clean_url($url) {
|
||||
if ('' == $url) return $url;
|
||||
$url = preg_replace('|[^a-z0-9-~+_.?#=&;,/:]|i', '', $url);
|
||||
|
|
Loading…
Reference in New Issue