By Hideto on Wednesday, 17 May 2017
Posted in Technical Issues
Likes 0
Views 607
Votes 0
Hello,

We use EasyProfile for user's profile data.
There, we already have custom field "Display Name".

So we need to use this "Display Name" as Author Name in EasyBlog.

Will you please advice us on how and what to modify?

Thanks,
rikao
Hello Arlex,

Thank you so much!

With a help of EasyProfile developer, I was able to successfully implement this by replacing


if ($type == 'nickname' && !empty($this->nickname)) {
$name = $this->nickname;
}


with


if ($type == 'nickname') {
require_once(JPATH_SITE.'/components/com_jsn/helpers/helper.php');
$name=JsnHelper::getUser($this->id)->getFormatName();
}


I'm so glad that now display name for EasyBlog and EasyProfile works seamlessly.
Thanks for your help,
rikao
·
Thursday, 18 May 2017 08:09
·
0 Likes
·
0 Votes
·
0 Comments
·
Actually Easyblog backend setting allow admin to set the user display name format, you can check my attached screenshot below.

If you would like to custom to use this EasyProfile custom field data, then you have to modify the Easyblog core file already.

First you have to understand how this EasyProfile retrieve the user name and how to render their name on the page.

For Easyblog, it will always call this getName() method, you can check on this following file location.

JoomlaFolder/administrator/components/com_easyblog/tables/profile.php
LINE 233
·
Wednesday, 17 May 2017 18:50
·
0 Likes
·
0 Votes
·
0 Comments
·
You're welcome.

Glad to heard you can achieve this .
·
Thursday, 18 May 2017 11:41
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post