Forums

[resolved] Comment Author Level or Role (3 posts)

  1. pete.kyle
    Member
    Posted 3 years ago #

    Hi,

    This question has been asked before but does not seem to be answered. Hope someone can help...

    When a comment is left I need to display the comment author's role after their name,
    i.e. Comment by <Comment Author's name> <Comment Author's Role> on <Comment Date>
    e.g. Comment by Pete (Admin) on 10/04/09

    I am struggling to identify the Comment Author's role. Any suggestions?

    Pete

  2. pete.kyle
    Member
    Posted 3 years ago #

    I managed to work it out...

    <?php $user_info = get_userdata($comment->user_id);
    
    					if ( $user_info->user_level == 10 ) {
    							echo('User level: ' . $user_info->user_level . "\n");
    					} ?>
  3. adam.codefor
    Member
    Posted 3 years ago #

    nice work man.

    Been looking to do this for the user_name and your idea worked a treat

Topic Closed

This topic has been closed to new replies.

About this Topic