Example #1
0
                $message = "success";
            } else {
                if ($_GET['object'] == "wallpost") {
                    WallPost::get_by_id($id)->delete();
                    $message = "success";
                } else {
                    if ($_GET['object'] == "likedboxsnap") {
                        LikedBoxSnap::get_by_id($id)->delete();
                        $message = "success";
                    } else {
                        if ($_GET['object'] == "wallpostcomment") {
                            WallPostComment::get_by_id($id)->delete();
                            $message = "success";
                        } else {
                            if ($_GET['object'] == "boxsnapcomment") {
                                BoxSnapComment::get_by_id($id)->delete();
                                $message = "success";
                            } else {
                                $message = "Object Specified Does Not Exists";
                            }
                        }
                    }
                }
            }
        }
    } else {
        $message = "No Object ID Specified";
    }
} else {
    $message = "No Create Object Specified";
}
Example #2
0
     $object = LikedBoxSnap::exists($_POST["boxsnapid"], $_POST["username"]);
     if (!$object) {
         $object = new LikedBoxSnap();
         $object->boxsnapid = $_POST["boxsnapid"];
         $object->username = $_POST["username"];
         $object->create();
     } else {
         $object = LikedBoxSnap::get_by_id_username($_POST["boxsnapid"], $_POST["username"]);
         if ($object) {
             $object->delete();
         }
     }
     $message = "success";
 } else {
     if ($_GET['object'] == "boxsnapcomment") {
         $object = new BoxSnapComment();
         $object->boxsnapid = $_POST["boxsnapid"];
         $object->username = $_POST["username"];
         $object->comment = $_POST["comment"];
         $object->create();
         $message = "success";
     } else {
         if ($_GET['object'] == "wallpostcomment") {
             $object = new WallPostComment();
             $object->boxsnapid = $_POST["wallpostid"];
             $object->username = $_POST["username"];
             $object->comment = $_POST["comment"];
             $object->create();
             $message = "success";
         } else {
             $message = "Object Specified Does Not Exists";
Example #3
0
             $object->name = $extendedprofile->name;
             if ($extendedprofile && $extendedprofile->picture) {
                 $theFile = "images/extendedprofiles/" . $extendedprofile->id . ".jpg";
                 if (!file_exists($theFile)) {
                     file_put_contents($theFile, base64_decode($extendedprofile->picture));
                 } else {
                     if (filesize($theFile) == 0) {
                         file_put_contents($theFile, base64_decode($extendedprofile->picture));
                     }
                 }
                 $object->profilepicture = HOST . "slir/w100/snapchat/includes/webservices/images/extendedprofiles/" . $extendedprofile->id . ".jpg";
             } else {
                 $object->profilepicture = "http://i.imgur.com/tmqV1Vo.png";
             }
             $object->likes = count(LikedBoxSnap::get_all_by_boxsnapid($object->id));
             $object->comments = count(BoxSnapComment::get_all_by_boxsnapid($object->id));
             if (isset($_GET['username'])) {
                 if (LikedBoxSnap::exists($object->id, $_GET['username'])) {
                     $object->liked = true;
                 }
             }
         }
     }
     $response = $objects;
 } else {
     if ($_GET['object'] == "wallpost") {
         $sql = "SELECT * FROM " . T_WALLPOSTS . " WHERE " . C_WALLPOST_TOUSERNAME . "='" . $_GET['tousername'] . "' ORDER BY id DESC LIMIT 20";
         $objects = WallPost::get_by_sql($sql);
         $filename = 0;
         if (count($objects) > 0) {
             foreach ($objects as $object) {