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:
$friendlist = new Friendlist($mysidia->user); //create your own friendlist object.
$friend = new Friend(new Member($mysidia->input->get("user")), $friendlist); //create a friend object.
if(!$friend->isfriend){ //only show if the user is a friend of yours.
$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));
}
Note the above code may need some tweaks, as if you are viewing the page as a guest you may get get a glitch. You can test it and lemme know how it goes.
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->db->delete("friend_requests", "(fromuser='{$mysidia->user->username}' AND touser='{$this->username}') OR (touser='{$mysidia->user->username}' AND fromuser='{$this->username}')");
This above code should delete a row with friend request between you and your old friend that you dont want to maintain friendship anymore. After the friend request is deleted, you should be able to send friend request to this user again without any problems.