juggledad |
Sep 29, 2009 08:54 AM |
[SOLVED] BUGFIX - 343 - Comments show 'Leave a Comment' even when comments are clos
this is a bug that was first introduced in version 3.3.3 due to a change in the way comment information was checked. The following change will do the following:
if comments are open it will display text string 1, 2, or 3 depending on which is appropriate
if comments are closed it will display
- nothing if text string 4 is 'dontshow'
- text string 4 if there are no comments, or
- text string 2 or 3 depending on the number of comments followed by text string 4
Edit bfa_postinfo.php and replace
line 23 (version 3.4.3)
HTML Code:
global $bfa_ata;
with
HTML Code:
global $bfa_ata, $post;
replace lines
lines 346-363 (version 3.4.3)
HTML Code:
// Comment link
if ( strpos($postinfo_string,'%comments(') !== FALSE ) {
$comment_options = preg_match("/(.*)%comments\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i",
$postinfo_string,$comment_matches);
if ( !comments_open() AND $comment_matches[8] == "dontshow" ) {
$comment_link = '';
} else {
ob_start();
comments_popup_link($comment_matches[2], $comment_matches[4],
$comment_matches[6], 'comments-link', $comment_matches[8]);
$comment_link = ob_get_contents();
ob_end_clean();
}
$postinfo = preg_replace("/(.*)%comments\((.*?)\)%(.*)/i", "\${1}" .
$comment_link. "\${3}", $postinfo);
}
with
HTML Code:
// Comment link
if ( strpos($postinfo_string,'%comments(') !== FALSE ) {
$comment_options = preg_match("/(.*)%comments\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i",
$postinfo_string,$comment_matches);
if ( !comments_open() AND $comment_matches[8] == "dontshow" ) {
$comment_link = '';
} else {
ob_start();
comments_popup_link($comment_matches[2], $comment_matches[4],
$comment_matches[6], 'comments-link', $comment_matches[8]);
$comment_link = ob_get_contents();
ob_end_clean();
}
if (!comments_open() ) {
if ($post->comment_count == 0) {
$comment_link = '<strong>' . $comment_matches[8] . '</strong>';
} else {
$comment_link = $comment_link . ' - <strong>(' . $comment_matches[8] . ')</strong>';
}
}
if ( !comments_open() AND $comment_matches[8] == "dontshow" ) {
$comment_link = '';
}
$postinfo = preg_replace("/(.*)%comments\((.*?)\)%(.*)/i", "\${1}" .
$comment_link. "\${3}", $postinfo);
}
|