示例#1
0
    $id = $_GET['friendid'];
    $userid = $_GET['userid'];
    $conf = $friends->verifyFriend($userid, $id);
    if ($conf < 0) {
        $msg = 'Failed to verify this friendship.';
        return;
    }
    if (empty($conf)) {
        event::fire('USER_CONFIRM_FRIEND');
        $msg = "You are now friends with this person. View their <a href='profile.php?userid=" . $id . "'>profile</a>.";
    } else {
        $msg = $conf;
    }
    return $msg;
}
if ($action == "ignoreFriend") {
    $id = $_GET['friendid'];
    $userid = $_GET['userid'];
    $conf = $friends->ignoreFriend($userid, $id);
    if ($conf < 0) {
        $msg = 'Failed to ignore this friendship.';
        return;
    }
    if ($conf == 1) {
        event::fire('USER_IGNORE_FRIEND');
        $msg = "You have now ignored this friendship.";
    } else {
        $msg = $conf;
    }
    return $msg;
}