![]() |
Friend System Questions
1) I've created a link on my user profiles to display a link to send a friend request. I'd like to prevent it from displaying on the profiles of users you're already friends with? Currently in classes/class_userprofile.php I have something like this:
PHP Code:
|
1. For this you will need to add an if check to the location that renders 'send a friend request' link on user profile page. Look for file classes/class_userprofile.php at around line 184-185, and you will find this:
PHP Code:
2. I honestly never tested the edge case when you attempt to add a friend back after you break friendship. So I think there is a chance that you cannot add him/her back since the friend request stays in database, you cannot send duplicate friend requests. If this happens, and it is not the desired behavior for you, you can simply remove the friend request from database once you remove a friend. |
1) Yes. The question was how do I write the check itself? I already have the contents how I want them. I just don't quite understand how I would need to form that. :cfrown:
2) Hmm... Where? (In the friend class's remove function?) Also not the most familiar with calls to the database to remove entries. Only one of the friends will have been the one to initiate the request.... hmm. :ooo: Thanks anyway, HoF! :happycbig: |
1. You will need to check if the user is on your friendlist, and only show the 'send a friend request' image and link when the user is not a friend of yours yet. The below steps demonstrates how to check this:
PHP Code:
2. Yeah, you can add one line to the friend class' remove method, to delete the row from table prefix_friend_requests. The code should look like this below: PHP Code:
|
Thanks!! :usedusedused:
|
All times are GMT -5. The time now is 11:38 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.