Wordpress Themes - WP Forum at BFA
Click Here To DONATE! Support the theme development, get more attention and additional benefits based on your donation level. Your forum name will be highlighted.

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages » Comments, trackbacks & pings »

Modying comment author display


Build custom WP THEMES, without
coding.
Click here for THEMEFRAME

From the author of Atahualpa, the #1 most
downloaded (700,000+) theme @ wordpress.org
  #1  
Old Apr 13, 2010, 09:44 AM
markelshark
 
11 posts · Nov 2009
Out of the box when a *logged-in* user types a comment on a Atahualpa blog it displays their nickname (which might be the same thing as their first name? not sure) next to their comment.

So for me, for example, my nickname is "Mark" and my username is "piphut". When I post a comment it takes the form of:

Mark: this is my comment.


What I would like to do is add the username next to the nickname, in parenthesis, next to an '@' symbol. The username would not link to anything, just be text. So the above comment would now look like:

Mark (@piphut): this is my comment.

Any suggestions?


P.S. for anyone interested this is because I recently integrated Buddypress with atahualpa and using the @username function works just like a twitter mention. @nickname does nothing.
  #2  
Old Apr 20, 2010, 02:20 PM
markelshark
 
11 posts · Nov 2009
bump. Any ideas for this?
  #3  
Old Apr 20, 2010, 05:53 PM
juggledad's Avatar
juggledad
 
22,253 posts · Mar 2009
OSX 10.8.5 WP 3.8.x Atahualpa 3.7.x Safari 6.x Firefox 25 XP
This is not something that is done in the theme, it's done in the wordpress code. the actual call to teh wordpress code is in bfa_custom_comment.php line 16 (in version 3.4.6) There you will see a comment_author_link() and that is the routing that gets the comments (it is in wp-includes/comment-template.php)

What is worse is that the value that is dislayed depends on the setting of the 'Display name publicly as' option of teh USER profile AT THE TIME THE COMMENT IS MADE. i.e. if the user name was 'admin' and the 'Display name publicly as' is 'admin' when you make a comment, the comment shows as being made by 'admin'. If you now go in to the admin user and add a nickname of 'The Man' and change teh 'Display name publicly as' to 'The Man' and make a comment, it will display as 'The Man' while the previous comment will show 'admin'

so....no there is no easy way to do what you want to do, the name associated with the comment is actually stored in the comment at the time it is made. - you can actually delete a user from te database and their name will still be associated with comments they have made.
__________________
"Tell me and I forget, teach me and I may remember, involve me and I learn." - Benjamin Franklin
Juggledad | Forum Moderator/Support
  #4  
Old Apr 24, 2010, 03:02 PM
dodge
 
1 posts · Apr 2010
Hi,

This is possible by hacking two lines in wp-comment-post.php.

check from line 50...

Quote:
if ( $user->ID ) {

//if ( empty( $user->display_name ) ) // comment this line out
// $user->display_name=$user->user_login; // comment this line out
$user->display_name = $user->display_name."(@".$user->user_login.")"; // add this to the line that sets the comment name
$comment_author = $wpdb->escape($user->display_name);
$comment_author_email = $wpdb->escape($user->user_email);
$comment_author_url = $wpdb->escape($user->user_url);

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] How can I enable author to edit its comment? 112358oo Comments, trackbacks & pings 2 Nov 10, 2009 08:22 AM
Author Pages (again) - display bio, links, etc? theangryblackwoman Atahualpa 3 Wordpress theme 1 Jun 10, 2009 08:37 AM
comment author link... designer666 Comments, trackbacks & pings 1 May 11, 2009 01:23 PM
Author comment background to appear the same in all levels of commenting perdox808 Comments, trackbacks & pings 0 Apr 21, 2009 06:19 AM
How to display the name of the author? wy007 Post-Kicker, -Byline & -Footer 2 Feb 5, 2009 12:36 AM


All times are GMT -6. The time now is 08:41 AM.


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