Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8092559
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:18:41+00:00 2026-06-05T20:18:41+00:00

I really need help this time – Joomla 2.5 and latest K2. I’m using

  • 0

I really need help this time – Joomla 2.5 and latest K2.
I’m using the default K2 comment system and I want to show the “Description” field for every commenter on that page.
So far I have this code:

$thisUserdata =& JFactory::getUser($comment->userID);
echo $thisUserdata->profile->description;

But this shows the description for the author of the page only.
If I log in with another account, it’ll also show my own Description as long as I’m logged in.

All the coding I’m doing is in /components/com_k2/templates/default/item.php

The whole code for comments looks like this:

<?php if($this->item->numOfComments>0 && $this->item->params->get('itemComments') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2'))): ?>
    <!-- Item user comments -->
      <ul>
        <?php foreach ($this->item->comments as $key=>$comment): ?>
        <li class="<?php echo ($key%2) ? "odd" : "even"; echo (!$this->item->created_by_alias && $comment->userID==$this->item->created_by) ? " author-comment" : ""; echo($comment->published) ? '':' unpublishedComment'; ?>">
            <div class="avatar">
                <?php if($comment->userImage): ?>
                <a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" target="_blank" rel="nofollow">
                    <img src="<?php echo $comment->userImage; ?>" alt="<?php echo JFilterOutput::cleanText($comment->userName); ?>" width="<?php echo $this->item->params->get('commenterImgWidth'); ?>" />
                </a>
                <?php endif; ?>
            </div>
            <div class="inner">
                <div class="author">
                    <?php if(!empty($comment->userLink)): ?>
                        <a href="<?php echo $comment->userLink; ?>" title="View <?php echo $comment->userName; ?> profile" target="_blank" rel="nofollow">
                            <?php echo $comment->userName; ?>
                        </a>
                    <?php else: ?>
                        <a rel="nofollow"><?php echo $comment->userName; ?></a>
                    <?php endif; ?>
                </div>
                <div class="date">
                    &#160;<?php echo JHTML::_('date', $comment->commentDate, JText::_('K2_DATE_FORMAT_COM_MARIO')); ?>
                </div>
                <p><?php echo $comment->commentText; ?>
                <?php
                // USER DESCRIPTION
                $thisUserdata =& JFactory::getUser($comment->userID);
                echo $thisUserdata->profile->description;
                ?>          
                </div>
            </div>
        </li>
        <?php endforeach; ?>
      </ul>

      <div class="itemCommentsPagination">
        <?php echo $this->pagination->getPagesLinks(); ?>
        <div class="clr"></div>
      </div>
<?php endif; ?>

<?php if($this->item->params->get('commentsFormPosition')=='below' && $this->item->params->get('itemComments') && !JRequest::getInt('print') && ($this->item->params->get('comments') == '1' || ($this->item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($this->item->catid)))): ?>
    <!-- Item comments form -->
    <div class="itemCommentsForm">
        <?php echo $this->loadTemplate('comments_form'); ?>
    </div>
<?php endif; ?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T20:18:42+00:00Added an answer on June 5, 2026 at 8:18 pm

    With Joomla 2.5 you can use that to get basic user information, but you want to use the following to get the “description” or “about me” content of the commenting user..

    $commentUser = JUserHelper::getProfile($comment->userID);
    print_r($commentUser);
    
    $about_me = $commentUser->profile['aboutme'];
    echo $about_me;
    

    Here is the link as well, this might help if you would like to do other things with the JUserHelper..

    http://api.joomla.org/Joomla-Platform/User/JUserHelper.html#getProfile

    EDIT: Make sure the plugin “User – Profile” is enabled or this will not work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I really need your help with this. We are planning on developing a real-time
Kindly need your help as this really taking me long time to try. From
I really need help with this. This time 2 days ago, my app was
I really need help with this last part of my program. I need to
I Really need help in this ... I'm building an application where I need
I really need help on this one. I am having a simple login form
Sorry to bother again, but I really need help transforming this Python2 code into
I really need your help for this. I am relatively new to programming and
I really need some help with this as I have been trying to fix
We Really need some help on this one: We've Struggled with all the Apple

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.