By Mist on Saturday, 05 March 2016
Posted in General Issues
Likes 0
Views 570
Votes 0
Hi guys, i think this is pretty easy but i can't find any info on how to do it ...

How do you get the profile type for a user and show info only if profile types match the one desired ?
Let me simplify this ..

Let's assume we have 2 profile types defined in EasySocial:
ID1 - Regular User
ID2 - Business User


In joomla articles (and other parts of our website / "outside" easysocial pages / article list, content modules and so on ...) i need to check if the author matches a specific user profile in EasySocial.

Something like ....

If (the author profile type in EasySocial is ID2) {
****** show this info ******
}

I think it's pretty easy to access the profile type and check if the user have a specific profile type, but i can't find any info on how to do it.

Any tips will help ! Thanks !
Hello Mist,

You can try use this code:

$file = JPATH_ROOT . '/administrator/components/com_easysocial/includes/easysocial.php';
// Include the engine file.
require_once($file);

$userId = 199; // get the user id for that author
$user = ES::user($userId);

// if the profile for this user is 2, do something
if ($user->profile_id == 2) {

}


Hope this helps.
·
Monday, 07 March 2016 10:32
·
0 Likes
·
0 Votes
·
0 Comments
·
COOL !!! Thanks a lot ! It's all i need
·
Monday, 07 March 2016 14:40
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Mist,

You're welcome.
·
Monday, 07 March 2016 15:23
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post