예제 #1
0
파일: social.php 프로젝트: Zyoruk/Odyssey
    {
        require_once "connect_sql.php";
        $userID = $_GET["uid"];
        $query = "SELECT COUNT(friends_id) AS c FROM friends_relation WHERE user_id = '{$userID}'";
        $result = mysql_query($query, $conn);
        if (!$result) {
            die("{error:'Error description: " . mysql_error($conn) . "'}");
            e($result);
        }
        $count = mysql_fetch_assoc($result)['c'];
        echo "{count:'{$count}'}";
    }
}
if (isset($_GET['Like']) && isset($_GET['sid']) && isset($_GET['uid'])) {
    $social = new Social();
    $social->like();
} else {
    if (isset($_GET['Dislike']) && isset($_GET['sid']) && isset($_GET['uid'])) {
        $social = new Social();
        $social->dislike();
    } else {
        if (isset($_GET['c']) && isset($_POST['comm']) && isset($_GET['sid']) && isset($_GET['uid'])) {
            $social = new Social();
            $social->comment();
        } else {
            if (isset($_GET['cp']) && isset($_FILES['file']) && isset($_GET['sid']) && isset($_GET['uid'])) {
                $social = new Social();
                $social->commentPhoto();
            } else {
                if (isset($_GET['gl']) && isset($_GET['sid'])) {
                    $social = new Social();