- Posts: 27
COMMUNITY FORUM
[SOLVED] How to display "User Name"?
- Dominik Kaptur
- Topic Author
- Offline
- Junior Member
Less
More
11 years 2 months ago #115868
by Dominik Kaptur
[SOLVED] How to display "User Name"? was created by Dominik Kaptur
How to display "User Name" instead of "Name" in comments?
Thank you.
<span class="commentAuthorName">
<?php echo JText::_('K2_POSTED_BY'); ?>
<?php if(!empty($comment->userLink)): ?>
<?php if($comment->userID): ?>
<a href="<?php echo $comment->userLink; ?>" title="<?php echo $comment->userName; ?>" rel="nofollow">
<?php endif; ?>
<?php echo $comment->userName; ?>
<?php if($comment->userID): ?>
</a>
<?php endif; ?>
<?php else: ?>
<?php echo $comment->userName; ?>
<?php endif; ?>
</span>
Thank you.
Please Log in or Create an account to join the conversation.
- Dominik Kaptur
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 27
11 years 2 months ago #115869
by Dominik Kaptur
Replied by Dominik Kaptur on topic Re: How to display "User Name"?
You don't know how to change it. Or you don't want to tell?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 2 months ago #115870
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: How to display "User Name"?
You have to snippet like this one.
<?php if(!empty($comment->userID)): ?>
<?php $user = JFactory::getUser($comment->userID); ?>
<?php echo $user->username; ?>
<?php endif; ?>
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Dominik Kaptur
- Topic Author
- Offline
- Junior Member
Less
More
- Posts: 27
11 years 2 months ago #115871
by Dominik Kaptur
Replied by Dominik Kaptur on topic Re: How to display "User Name"?
Works fine.
Thank you very much.
Thank you very much.
Please Log in or Create an account to join the conversation.
- Joe Collins
- Offline
- New Member
Less
More
- Posts: 13
11 years 1 month ago #115872
by Joe Collins
Replied by Joe Collins on topic Re: How to display "User Name"?
Which file is this you are editing? A little bit more information would go a long way.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
11 years 1 month ago #115873
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: How to display "User Name"?
It 's in item.php
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.