Exemple #1
0
     }
 }
 if ($_GET['object'] == "shoutbox") {
     ShoutBox::get_by_id($id)->delete();
     $message = "success";
 } else {
     if ($_GET['object'] == "boxsnap") {
         BoxSnap::get_by_id($id)->delete();
         $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";
                     }
                 }
             }
         }
Exemple #2
0
     if (isset($_FILES['picture'])) {
         $file = new File($_FILES['picture']);
         $object->picture = $file->data;
     }
     $object->create();
     $message = "success";
 } else {
     if ($_GET['object'] == "likedboxsnap") {
         $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") {
Exemple #3
0
                 $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) {
                 $theFile = "images/boxsnaps/" . $object->id . ".jpg";
                 if (!file_exists($theFile)) {