Skip Navigation

[Gelöst] Friend request

This support ticket is created vor 2 Jahre, 7 Monate. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 2 Antworten, has 2 Stimmen.

Last updated by Oniromancer vor 2 Jahre, 7 Monate.

Assigned support staff: Waqar.

Author
Artikel
#1594715

Hello

I'm trying to make a very simplified basic version of some features of BuddyPress to study Toolset.
So far I've created a member's list using the types_render_usermeta.
Now I would like to add a friend request button on the user's profile archive and single page.
The user will receive a friend request notification and can accept or refuse.
For now, the notification doesn't need to be in realtime. Could you give me a start on this?

Thanks, cheers

#1595449

Waqar
Supporter

Languages: Englisch (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

Since this feature is not offered out-of-box, this will require a fair deal of customization.

Although 1-1 customization, is beyond the scope of support that we can provide, we do our best to guide in the right direction, whenever possible.

1. If you're not already using it, you can create a new custom post type, for example, "User Profiles" so that for every user, there exists exactly one post in this post type.

This will allow you to link user profiles with other post types on the website since users can't be directly connected to post types through post relationships.

You'll find more details on the topic in this guide:
https://toolset.com/documentation/post-relationships/how-to-create-custom-searches-and-relationships-for-users/

2. For tracking friend requests, you can add a new numeric and repeating custom field in the "User Profiles" post type. When X user will send a friend request to Y user, in Y user's "User Profile" post, one entry with that custom field can be added with the ID of the X user's "User Profile" post.

When you'll get the record of all the IDs stored in that custom field for a particular user, you'll get the information of all users who have sent friend requests.

You'll find useful hooks for Toolset Forms data manipulation at:
https://toolset.com/documentation/programmer-reference/cred-api/

3. Just like for friend requests, you can add another numeric repeating custom field in the "User Profiles" post type for approved friends.

Whenever a friend request gets approved, IDs of both user's "User Profile" posts can be stored in each other's posts.

I hope these pointers will help and for more personalized assistance around customization, you can also consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/

regards,
Waqar

#1595461

Interesting. I will work on that. Thank you!