UPDATES EasyBlog 6.0.14 Released! Joomla 5.x and PHP 8.x compatible now!

Helpdesk

Your Time
Our Time
Response Time
24 — 48 hours
We strive to provide the fastest ever response possible. However, we are not super beings.

Allow at least 24 — 48 hours
  Support is offline
It is currently off working hours and most of us aren't around

Rest assured that we will get back to you as soon as the day starts tomorrow!
  Support is offline

Make a list of friends of a member

Fagault Eric · ·
2:01 PM Wednesday, 09 August 2017
None
Hello,
I want to build a table of the member's contact list (thanks to its id)
I started like that, but maybe there is a more sophisticated way of doing that?


$state = 1; // 1 pour les amis / -1 si la personne n'est plus amie

$db = JFactory::getDbo();
$query = $db->getQuery(true);
$query->select(array('actor_id'))
->from($db->quoteName('#__social_friends'))
->where($db->quoteName('target_id')." = ".$db->quote($idTarget)."AND".$db->quoteName('state')." = ".$db->quote($state));
$db->setQuery($query);
$row = $db->loadRowList();
// print_r ($row);


Best regards.

Eric
The replies under this section are restricted to logged in users or users with an active subscription with us