Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » New Versions, & Updating » Old Version fixes and change logs »

[SOLVED] BUGFIX - 343 - Comments show 'Leave a Comment' even when comments are clos


  #1  
Old Sep 29, 2009, 08:54 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
[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);
        
	}
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Last edited by juggledad; Sep 29, 2009 at 08:57 AM.
  #2  
Old Sep 29, 2009, 07:07 PM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Fixed in 3.4.4
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] BUGFIX - 3.4.1-&gt;3.4.6 - Comment form will not show up after first comment on juggledad Comments, trackbacks & pings 49 Jul 29, 2010 06:01 PM
Comment Link Redirects to the Top of Page and No Comments Show The Gourmand & the Peasan Comments, trackbacks & pings 3 Jun 3, 2010 08:47 AM
[SOLVED] How do I show &quot;Leave A Comment&quot; after there are already comments to a post? despr8caregiver Comments, trackbacks & pings 2 Apr 27, 2010 10:49 PM
Show and Hide comments using 'Show Comments' link Alexa Comments, trackbacks & pings 4 Feb 17, 2010 11:51 AM
On comments page for post Leave a Reply and comments are white daisy24 Comments, trackbacks & pings 4 Feb 19, 2009 06:40 AM


All times are GMT -6. The time now is 03:21 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.