![]() |
|
#1
|
||||
|
||||
![]()
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:
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. Last edited by Kyttias; 01-05-2016 at 10:45 PM. |
#2
|
||||
|
||||
![]()
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.
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#3
|
||||
|
||||
![]()
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.
![]() 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. ![]() Thanks anyway, HoF! ![]()
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
#4
|
||||
|
||||
![]()
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:
__________________
![]() Mysidia Adoptables, a free and ever-improving script for aspiring adoptables/pets site. |
#5
|
||||
|
||||
![]()
Thanks!!
![]()
__________________
Please do not contact me directly outside of Mysidia.
I also cannot troubleshoot code more than two years old - I legit don't remember it. |
![]() |
Thread Tools | |
Display Modes | |
|
|
What's New? |
What's Hot? |
What's Popular? |