Beispiel #1
0
            echo $Relation->likeFeed($user_id, $feed_id);
            echo $Relation->createNotification($data);
            break;
        case 'unlike_feed':
            $user_id = $_POST['user_id'];
            $feed_id = $_POST['feed_id'];
            echo $Relation->unlikeFeed($user_id, $feed_id);
            break;
        case 'editAvatarLink':
            $user_id = $_POST['user_id'];
            $avatar_url = basename($_POST['avatarURL']);
            if ($Profile->editAvatarLink($user_id, $avatar_url)) {
                echo json_encode('updated');
            }
            break;
        case 'check_update':
            $user_id = $_POST['user_id'];
            $type = $_POST['type'];
            if ($type == 'messages-popup') {
                echo $Inbox->checkInbox($user_id);
            } else {
                if ($type == 'notification-popup') {
                    echo $Relation->checkNotifications($user_id);
                }
            }
            break;
        default:
            return "bloop";
            break;
    }
}