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 » Center area post/pages » Post-Kicker, -Byline & -Footer »

[SOLVED] More option comment numbering on Byline.


  #1  
Old Apr 20, 2013, 04:26 AM
giacinto
 
10 posts · Apr 2013
Good morning and congratulations for the great theme.
In wp-includes (comment-templates.php) I changed the original function comments_number in order to have a fifth option ($ zero = false, $ one = false, $ less = false, $ more = false, $ deprecated = '').
The code works fine on the pages of posts.
What I ask is: how do I implement the same function to have the vision of the counts even in the setting of the byline?.
I use Ata 3.7.10 and wp 3.5.1
Thanks
  #2  
Old Apr 20, 2013, 04:44 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
you'll probably have to edit bfa_postinfo.php but first I'd suggest you upgrade to 3.7.12
  #3  
Old Apr 20, 2013, 05:22 AM
giacinto
 
10 posts · Apr 2013
Thanks kind Mr. Juggledad.
Honestly though, I can not proceed. Can you be so kind as to tell me exactly where and what to change?.
Thanks
  #4  
Old Apr 20, 2013, 06:29 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
not really, not without knowing what you did to comment-templates.php and then spending a lot of time looking at the interaction.

This is not a theme issue and beyond what I'm willing to do for free because of how much of my time would be involved.

If you aren't capable of doing this, I suggest you advertise and see if you can hire someone to do it or rethink the need for this.
  #5  
Old Apr 20, 2013, 06:59 AM
giacinto
 
10 posts · Apr 2013
What you wrote is correct and I can not pretend, of course.
I hope that seeing the changes that I have made, you can guess if the problem is solved or not.
Thanks anyway gentle Mr. Juggledad.

Code:
function comments_number( $zero = false, $one = false, $less = false, $more = false, $deprecated = '' ) {
	if ( !empty( $deprecated ) )
		_deprecated_argument( __FUNCTION__, '1.3' );

	$number = get_comments_number();
	if ( $number > 1 && $number <12 )
		$output = str_replace('§', number_format_i18n($number), ( false === $less ) ? __('§ Comments') : $less);
	elseif ( $number >= 12 )
		$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
	elseif ( $number == 0 )
		$output = ( false === $zero ) ? __('No Comments') : $zero;
	else // must be one
		$output = ( false === $one ) ? __('1 Comment') : $one;

	echo apply_filters('comments_number', $output, $number);
...and others little pieces of code.

Two of the results are these:
Attached Thumbnails
Click image for larger version

Name:	atapost.jpg
Views:	1856
Size:	10.7 KB
ID:	2315  Click image for larger version

Name:	atapost1.jpg
Views:	1826
Size:	12.3 KB
ID:	2316  

Last edited by giacinto; Apr 20, 2013 at 07:55 AM.
  #6  
Old Apr 22, 2013, 05:49 AM
giacinto
 
10 posts · Apr 2013
Good afternoon Mr. Juggledad,
really you can't help me, just only addressing me on the right way?.
I'm sure that the others guys like the adding option.
Please!.
Best regards
  #7  
Old Apr 22, 2013, 06:37 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
You are looking for a custom modification to the theme. This is beyond the scope of this forum.

I suggest you hire someone to do it for you.
  #8  
Old Apr 23, 2013, 02:11 AM
giacinto
 
10 posts · Apr 2013
Right!.
Thank you Mr. Juggledad!.
  #9  
Old Apr 26, 2013, 03:33 AM
giacinto
 
10 posts · Apr 2013
Good morning, kind Mr. Juggledad.
It was not really that hard. All it took was fiddling about thirty minutes and at the end I got what I wanted, without losing, in fact, long time.
I think that a capable person like you, would solve the problem in two minutes and would not have engaged for hours, as you had written.
Sometimes it would be advisable not stick exclusively for the purposes of the forum, because we are all "in the same boat."
Have a wonderful day!.
  #10  
Old Apr 26, 2013, 03:48 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
so why don't you share your solution for others?
  #11  
Old Apr 26, 2013, 05:17 AM
giacinto
 
10 posts · Apr 2013
Hello gentle Mr. Juggledad.
I didn't it, because you wrote that the question that I have submitted, is not part of the interest of this blog!.
  #12  
Old Apr 26, 2013, 05:33 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
I said it wasn't a theme issue and I wasn't willing to dig into it.

Bbut since you have figured it out, why not share your solution with others on the forum. Write up a detailed explaination of what you did...after all isn't that what you wanted me to do?
  #13  
Old Apr 26, 2013, 07:13 AM
giacinto
 
10 posts · Apr 2013
All right!.
My little need came from the desire to highlight the items with a substantial number of comments.
As I described before, the function should give me back not 4 but 5 conditions: 0, 1, >1 and <?​​, >?.
First I find the function 'comments_number' in wp-includes/comment-template.php, and I laid down the conditions as in the following pieces of code.
Code:
function comments_number( $zero = false, $one = false, $less = false, $more = false, $deprecated = '' ) {
	if ( !empty( $deprecated ) )
		_deprecated_argument( __FUNCTION__, '1.3' );

	$number = get_comments_number();
	if ( $number > 1 && $number <12 )
		$output = str_replace('§', number_format_i18n($number), ( false === $less ) ? __('§ Comments') : $less);
	elseif ( $number >= 12 )
		$output = str_replace('%', number_format_i18n($number), ( false === $more ) ? __('% Comments') : $more);
	elseif ( $number == 0 )
		$output = ( false === $zero ) ? __('No Comments') : $zero;
	else // must be one
		$output = ( false === $one ) ? __('1 Comment') : $one;

	echo apply_filters('comments_number', $output, $number);
}
...after

Code:
function comments_popup_link( $zero = false, $one = false, $less = false, $more = false, $css_class = '', $none = false ) {
	global $wpcommentspopupfile, $wpcommentsjavascript;

	$id = get_the_ID();

	if ( false === $zero ) $zero = __( 'No Comments' );
	if ( false === $one ) $one = __( '1 Comment' );
	if ( false === $less ) $less = __( '§ Comments' );
	if ( false === $more ) $more = __( '% Comments' );  
	if ( false === $none ) $none = __( 'Comments Off' );

....
...after

Code:
....
	echo ' title="' . esc_attr( sprintf( __('Comment on %s'), $title ) ) . '">';
	comments_number( $zero, $one, $less, $more, $none );
	echo '</a>';
....
After that I changet too the bfa_postinfo.php in the folder functions in Atahualpa Theme at the position of the below code:

Code:
....
			$comment_options = preg_match("/(.*)%comments\('(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*?)'(.*)/i",

	        $postinfo_string,$comment_matches);

        

			if ( !comments_open() AND $comment_matches[10] == "dontshow" ) { 

				$comment_link = ''; 

			} else { 

				ob_start(); 

					comments_popup_link($comment_matches[2], $comment_matches[4],

    	     		 $comment_matches[6],	 $comment_matches[8], 'comments-link', $comment_matches[10]);

					$comment_link = ob_get_contents(); 

				ob_end_clean(); 

			}



			if (!comments_open() ) {

				if ($post->comment_count == 0) {

					$comment_link = '<strong>' . $comment_matches[10] . '</strong>';

				} else {

					$comment_link = $comment_link . ' - <strong>(' . $comment_matches[10] . ')</strong>';

					}

			}

			if ( !comments_open() AND $comment_matches[10] == "dontshow" ) { 

				$comment_link = ''; 

			}
....
On BYLINE of Homepage and Multi Post Pages I put the following code:
Code:
....
%comments('  <image(comment.gif)> 0 ', '  <image(comment.gif)> 1 ', '  <image(comments.gif)> § ', '  <image(comments.gif)>  %  and some other thing, just for to point out the post ', ' ')%
....

That's all!.
-------------------
I made also some variations in the comment.php, but for to show what I posted already and you can see on the above pictures.
  #14  
Old Apr 26, 2013, 07:16 AM
giacinto
 
10 posts · Apr 2013
Hello gentle Mr. Juggledad,
What do you think of this?.
Friendliness
  #15  
Old Apr 26, 2013, 07:19 AM
juggledad's Avatar
juggledad
 
23,765 posts · Mar 2009
OSX 10.11.5 WP 4.x Atahualpa(all) Safari, Firefox, Chrome
Good job! hopefully someone else may find this helpful.

btw don't forget that the next time you update WordPress or the theme you will have to redo part or all of this.
  #16  
Old Apr 26, 2013, 07:25 AM
giacinto
 
10 posts · Apr 2013
Hello gentle Mr. Juggledad,
Thank you... I keep in my mind your suggestions!.
A next.
Bye

Bookmarks

Tags
byline, comment numbering, more option

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Greg's Comment Numbering Plugin and Styling Nolie Comments, trackbacks & pings 9 Sep 28, 2017 03:42 AM
[SOLVED] &quot;Quick and Dirty Comment Numbering&quot; Not working for latest update of the the Shan_LSOS Comments, trackbacks & pings 5 Oct 26, 2010 12:03 AM
[SOLVED] Quick/Dirty Comment Numbering rickheck Comments, trackbacks & pings 8 Aug 25, 2010 10:20 AM
[SOLVED] Numbering comments using Greg's Threaded Comment Plugin perdox808 Comments, trackbacks & pings 7 Dec 6, 2009 10:16 AM
Please help... Comment numbering jmarsden92 Comments, trackbacks & pings 1 Jul 28, 2009 04:23 AM


All times are GMT -6. The time now is 05:00 PM.


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