- Posts: 15920
COMMUNITY FORUM
display comment author username not name
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
10 years 1 month ago #132335
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic Re: [SOLVED] display comment author username not name
You have to locate within the comments loop.
this part
Also don't forget to override.
Lines change from template to template so this is a safer method.
<?php foreach ($this->item->comments as $key=>$comment): ?>
this part
<?php if(!empty($comment->userLink)): ?>
<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" title="<?php echo JFilterOutput::cleanText($comment->userName); ?>" target="_blank" rel="nofollow">
<?php echo $comment->userName; ?>
</a>
<?php else: ?>
<?php echo $comment->userName; ?>
<?php endif; ?>
Also don't forget to override.
Lines change from template to template so this is a safer method.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Ingo
- Offline
- New Member
Less
More
- Posts: 3
6 years 4 months ago - 6 years 4 months ago #168479
by Ingo
Replied by Ingo on topic [SOLVED] display comment author username not name
Sorry for digging out this old topic but I still can't solve this problem!
Is this solution still the one for a 2.8.0 K2?
Since we have a new regulation in Europe since May 2018 the GDPR (General Data Protection Regulation) it can turn out in big problems displaying the real name of a user in the comments!
So this issue should be impact every one using K2 comments in Europe.
I tried to follow your instructions, but got lost.....
I don't know where to find the "comment loop".
In which folder/file do I find this?
I located at components/com_k2/views/comments/view.html.php were I foundbut if I change tonothing changed?
Wrong file?
Would apprechiate any help!
Cheers Ingo
Is this solution still the one for a 2.8.0 K2?
Since we have a new regulation in Europe since May 2018 the GDPR (General Data Protection Regulation) it can turn out in big problems displaying the real name of a user in the comments!
So this issue should be impact every one using K2 comments in Europe.
I tried to follow your instructions, but got lost.....
I don't know where to find the "comment loop".
In which folder/file do I find this?
I located at components/com_k2/views/comments/view.html.php were I found
$user = JFactory::getUser();
$user = JFactory::getUser($comment->userID);
Wrong file?
Would apprechiate any help!
Cheers Ingo
Last edit: 6 years 4 months ago by Ingo.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 4 months ago #168481
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic [SOLVED] display comment author username not name
Hello,
This is a core file, you need to roll back and reinstate the original code.
You need to edit the item.php file in your overrides getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
This is a core file, you need to roll back and reinstate the original code.
You need to edit the item.php file in your overrides getk2.org/documentation/tutorials/174-templating-with-k2-and-the-concepts-of-sub-templates
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Ingo
- Offline
- New Member
Less
More
- Posts: 3
6 years 4 months ago - 6 years 4 months ago #168482
by Ingo
Replied by Ingo on topic [SOLVED] display comment author username not name
Thank you Krikor!
This was the missing link for my understanding!
I'm not an expert but happy to got the proplem solved with your help!
Just to make sure not implementing another error.... I changed all 3 "userName" into userID"! That's right?
<?php if(!empty($comment->userLink)): ?>
<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" title="<?php echo JFilterOutput::cleanText($comment->userName); ?>" target="_blank" rel="nofollow">
<?php echo $comment->userName; ?>
</a>
<?php else: ?>
<?php echo $comment->userName; ?>
<?php endif; ?>
Cheers Ingo
This was the missing link for my understanding!
I'm not an expert but happy to got the proplem solved with your help!
Just to make sure not implementing another error.... I changed all 3 "userName" into userID"! That's right?
<?php if(!empty($comment->userLink)): ?>
<a href="<?php echo JFilterOutput::cleanText($comment->userLink); ?>" title="<?php echo JFilterOutput::cleanText($comment->userName); ?>" target="_blank" rel="nofollow">
<?php echo $comment->userName; ?>
</a>
<?php else: ?>
<?php echo $comment->userName; ?>
<?php endif; ?>
Cheers Ingo
Last edit: 6 years 4 months ago by Ingo.
Please Log in or Create an account to join the conversation.
- Ingo
- Offline
- New Member
Less
More
- Posts: 3
6 years 4 months ago - 6 years 4 months ago #168483
by Ingo
Replied by Ingo on topic [SOLVED] display comment author username not name
Ooops celabrating too early.....
The usernames are gone, but if I hover the mouse over the UserID, I get the link to the user and there is still the full name?
Anyway the links don't work and I don't want these links. Can I remove the link somehow?
The usernames are gone, but if I hover the mouse over the UserID, I get the link to the user and there is still the full name?
Anyway the links don't work and I don't want these links. Can I remove the link somehow?
Last edit: 6 years 4 months ago by Ingo.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
- Offline
- Platinum Member
Less
More
- Posts: 15920
6 years 4 months ago #168525
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic [SOLVED] display comment author username not name
Hello,
The user's page is being generated from the user.php file.
Since this is a registered user he has given the consent for his name to be displayed, this is not an issue with the new regulation. You can edit the user.php file and hide the user's info.
The user's page is being generated from the user.php file.
Since this is a registered user he has given the consent for his name to be displayed, this is not an issue with the new regulation. You can edit the user.php file and hide the user's info.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- John
- Offline
- New Member
Less
More
- Posts: 2
5 years 7 months ago #171683
by John
Replied by John on topic display comment author username not name
Can you navigate us on how can we change the real name of the author on comments to username instead?
When I used the userName on item.php it shows the real name instead of username that they are set on their registration of our site,
When I tried to used the userID its only shows the id number, which is not what we like to have..
Please help thanks
When I used the userName on item.php it shows the real name instead of username that they are set on their registration of our site,
When I tried to used the userID its only shows the id number, which is not what we like to have..
Please help thanks
Please Log in or Create an account to join the conversation.
- JoomlaWorks
- Offline
- Admin
Less
More
- Posts: 6218
5 years 7 months ago #171741
by JoomlaWorks
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by JoomlaWorks on topic display comment author username not name
If you used the "username" property yet saw actual names, it's because some users confuse these 2 things and just add their name in the username field when registering...
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.