Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi,
how can I can if there is an friendship request for a user-id?
Does there exist any function to do this?
thx
Comments
Comment #1
63reasons-AS CreditAttribution: 63reasons-AS commentedPlease explain your point in detail.
thanks
63reasons-AS
Comment #2
alex.k CreditAttribution: alex.k commentedfunction user_relationships_load() does this. Pls read docs in user_relationships_api.api.inc. For example, to check if there are pending requests to a user, you can run
Comment #3
dummas_324324_32 CreditAttribution: dummas_324324_32 commentedthanks.
Comment #4
dummas_324324_32 CreditAttribution: dummas_324324_32 commentedclosed
Comment #5
igorik CreditAttribution: igorik commentedHi
as I wrote in http://drupal.org/node/387542
I am looking for an option to get number of ONLY pending requests I got from other users
Not both (my requests to other users and requests of others to me) as it is now (maybe I am wrong).
Now when I use
I got number of pending requests from other users together with my pending requests what I send to others.
This is not really intuitive. I would like to show only number of requests from others what want to be friends with me and notice user about this (if this number is different from zero).
maybe it could be new value for approved param, e.g. -1: 'approved'->-1
thanks for the help
Comment #6
mrf CreditAttribution: mrf commentedThat snippet above should only return th count for pending relationships initiated by someone other than the current user with the current user as the object of the request.
If user_relationships_load is returning too many results in this case please open a new bug.