开发者

Drupal 6 - Flag friend module - filtering friended users (or similar)

开发者 https://www.devze.com 2023-02-26 05:30 出处:网络
I\'m using the flag friend module, and I\'m trying to accomplish what I thought would be an easy task.

I'm using the flag friend module, and I'm trying to accomplish what I thought would be an easy task.

Basically I'm trying to achieve some variation of 'Show all site users in a view, but indicate which ones are the current logged-in user's friends'. Should be easy I would have thought, but I've spent all day on this and it ain't working. :(

A related option I'开发者_JS百科ve tried is to actually filter out the friended users, but I can't get that to work either.

I'm feeling like this question should be more comprehensive, so apologies if that's the case!


This solution isn't elegant, but it'd work...

You can get a set of user objects by using the flag_friend_get_friends function and use that to identify friendly users from the view's template.

If you'd prefer get just the friend uids you can query the table directly using

db_query('SELECT f.friend_uid FROM {flag_friend} f WHERE f.uid = %d', $user->uid)

I'm not super happy with these, but they will work for you.

Hope someone else comes up with something better.

0

精彩评论

暂无评论...
验证码 换一张
取 消