View Single Post
  #2  
Old 01-06-2016, 01:13 PM
Hall of Famer's Avatar
Hall of Famer Hall of Famer is offline
Administrator, Lead Coder
 
Join Date: Dec 2008
Location: South Brunswick
Posts: 4,448
Gender: Male
Credits: 398,965
Hall of Famer is on a distinguished road
Default

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:
      $document->add(new Image("templates/icons/fr.gif""Send a Friend Request"));
      
$document->add(new Link("friends/request/{$member->uid}""Send {$mysidia->input->get("user")} a Friend Request"TRUE)); 
What you can do is to add an if check to this block of code, and to add friend request image/link to document only if the user is not a friend with you yet.


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.
Reply With Quote