27 : string
28 {
29 $joins = [];
30
31 $joins[] = implode(' ', [
32 'INNER JOIN buddylist',
33 'ON ((',
34 'buddylist.usr_id = usr_data.usr_id AND',
35 'buddylist.buddy_usr_id = ' . $this->db->quote($this->user_id, 'integer'),
36 ') OR (',
37 'buddylist.buddy_usr_id = usr_data.usr_id AND',
38 'buddylist.usr_id = ' . $this->db->quote($this->user_id, 'integer'),
39 '))',
40 ]);
41
42 $joins[] = implode(' ', [
43 'LEFT JOIN usr_pref profpref',
44 'ON profpref.usr_id = usr_data.usr_id',
45 'AND profpref.keyword = ' . $this->db->quote('public_profile', 'text'),
46 ]);
47
48 $joins[] = implode(' ', [
49 'LEFT JOIN usr_pref pubemail',
50 'ON pubemail.usr_id = usr_data.usr_id',
51 'AND pubemail.keyword = ' . $this->db->quote('public_email', 'text'),
52 ]);
53
54 return 'usr_data ' . implode(' ', $joins);
55 }