New comment status code.

git-svn-id: http://svn.automattic.com/wordpress/trunk@162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
saxmatt 2003-06-04 19:36:35 +00:00
parent a2b5bf6171
commit 2768a4eab3
1 changed files with 21 additions and 15 deletions

View File

@ -912,24 +912,30 @@ function comments_popup_script($width=400, $height=400, $file='b2commentspopup.p
echo $javascript; echo $javascript;
} }
function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='') { function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {
global $id, $b2commentspopupfile, $b2commentsjavascript; global $id, $b2commentspopupfile, $b2commentsjavascript, $post, $wpdb, $tablecomments;
global $querystring_start, $querystring_equal, $querystring_separator, $siteurl; global $querystring_start, $querystring_equal, $querystring_separator, $siteurl;
echo "<a href=\"$siteurl/"; $number = $wpdb->get_var("SELECT COUNT(*) FROM $tablecomments WHERE comment_post_ID = $id");
if ($b2commentsjavascript) { if (0 == $number && 'closed' == $post->comment_status) {
echo $b2commentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1'; echo $none;
echo '" onclick="b2open(this.href); return false"'; return;
} else { } else {
// if comments_popup_script() is not in the template, display simple comment link echo "<a href=\"$siteurl/";
comments_link(); if ($b2commentsjavascript) {
echo '"'; echo $b2commentspopupfile.$querystring_start.'p'.$querystring_equal.$id.$querystring_separator.'c'.$querystring_equal.'1';
echo '\' onclick="b2open(this.href); return false"';
} else {
// if comments_popup_script() is not in the template, display simple comment link
comments_link();
echo '"';
}
if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"';
}
echo '>';
comments_number($zero, $one, $more);
echo '</a>';
} }
if (!empty($CSSclass)) {
echo ' class="'.$CSSclass.'"';
}
echo '>';
comments_number($zero, $one, $more);
echo '</a>';
} }
function comment_ID() { function comment_ID() {