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.
Hello.
Trying to achieve a list of Non-Friends in Views .Since I have a list of Friends already, I don't want them duplicated on a "Users" page.
I have tried various filters, relationships and arguments with no luck.
Here is what I am thinking should work :
Filters
User Relationship Type (RTID) : Empty
Relationships
Requester
Requestee
Arguments
Requester ID
Fields
(Requestee) User : Email
Help?
Comments
Comment #1
kvvnn CreditAttribution: kvvnn commentedEDIT :
This actually lists a view of all users that have no relationships at all.
Comment #2
kvvnn CreditAttribution: kvvnn commentedEDIT : I think the above Views config was kind of stupid. Heres what I think should work :
Comment #3
kvvnn CreditAttribution: kvvnn commentedI believe what the above is doing is simply not listing friends of the current user.
However, it will not filter out friends of some other user who also happen to be friends with the current user.
Comment #4
kvvnn CreditAttribution: kvvnn commentedI have resorted to this solution instead : http://drupal.org/node/409432#comment-1826252
Where I have a Users page with every user on the site, but differentiate between friends and non-friends of the user.
I do believe that UR should include a view for "Friends" and for "Non Friends".
Cheers!
Comment #5
alex.k CreditAttribution: alex.k commentedTo help me understand, are you trying to list users who are not friends of you, or are you trying to list users who don't have any friends at all on the site?
Comment #6
kvvnn CreditAttribution: kvvnn commentedSorry for the confusion.
I am trying to list users who are not friends of the currently logged in user.
Comment #7
kvvnn CreditAttribution: kvvnn commentedUpdate on the above:
Issue : There is no way (that I have found) to have a view with both Friends and Non-Friends listed, and then filter out Non-Friends through an exposed filter.
Comment #8
kvvnn CreditAttribution: kvvnn commentedComment #9
alex.k CreditAttribution: alex.k commentedYup, the only way would be to use two different views, or two displays within the same view.
Comment #10
kvvnn CreditAttribution: kvvnn commentedThe issue with having two displays within the same view is that we can't have combined sorting.
Are you planning on implementing this feature?
Comment #11
YK85 CreditAttribution: YK85 commentedAny further development in User Relationships & Views integration?
If anyone has figured out a method can it please be shared with the community.
Thanks!
Comment #12
kvvnn CreditAttribution: kvvnn commentedThe only thing you can do is manipulate the fields once they come out. There is currently no way, using Views, to only list people who are not friends.
My suggestion is to use the Views_Customfield module (www.drupal.org/project/views_customfield) in a way that manipulates the user field based on whether the logged in user is friends with them.
Here is my example.
FiltersNode: Type = Profile
FieldsUser: Current No
Content: First Name exposed
Content: Last Name exposed
User: Uid Uid
Fields explainedContent: Profile Image
Content: First Name Default
Content: Last Name Default
User: Name Name
Customfield: PHP code Data
Customfield: PHP code
Everything is excluded except Content: Profile Image and Customfield: PHP Code
Customfield: PHP code Data: This is Excluded in production. It is to see the field names according to Views Customfield. In order to do that you use
Customfield: PHP code: This contains code that determines what to print depending on whether the user is a friend or not.
Comment #13
YK85 CreditAttribution: YK85 commentedwould this be helpful? http://drupal.org/project/viewsphpfilter
or could someone look into expanding UR-Views integration to allow for all the essential views?
many thanks!
Comment #14
aliyayasir CreditAttribution: aliyayasir commentedPlease take a look at Suggest a Friend module
http://drupal.org/project/suggest-a-friend