Comments number bug.

git-svn-id: http://svn.automattic.com/wordpress/trunk@701 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2004-01-03 05:03:28 +00:00
parent 823edb960d
commit 986c08cc1f
2 changed files with 2 additions and 2 deletions

View File

@ -261,7 +261,7 @@ if ($posts) {
foreach ($posts as $post) { start_wp(); foreach ($posts as $post) { start_wp();
?> ?>
<p> <p>
<strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comments', '1 comment', "% comments", true) ?></a> <strong><?php the_time('Y/m/d @ H:i:s'); ?></strong> [ <a href="edit.php?p=<?php echo $id ?>&c=1"><?php comments_number('no comments', '1 comment', "% comments") ?></a>
<?php <?php
if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) { if (($user_level > $authordata->user_level) or ($user_login == $authordata->user_login)) {
echo " - <a href='post.php?action=edit&amp;post=$id"; echo " - <a href='post.php?action=edit&amp;post=$id";

View File

@ -1558,7 +1558,7 @@ function list_cats($optionall = 1, $all = 'All', $sort_column = 'ID', $sort_orde
// generic comments/trackbacks/pingbacks numbering // generic comments/trackbacks/pingbacks numbering
function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $number) { function comments_number($zero='No Comments', $one='1 Comment', $more='% Comments', $number='') {
global $id, $comment, $tablecomments, $wpdb; global $id, $comment, $tablecomments, $wpdb;
if ('' == $number) $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'"); if ('' == $number) $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id AND comment_approved = '1'");
if ($number == 0) { if ($number == 0) {