Esempio n. 1
0
 public function addtoshoutbox()
 {
     $message = new ShoutBox();
     $message->id = 1;
     $message->message = Input::get('msg');
     $message->save();
 }
Esempio n. 2
0
<?php

require_once "../initialize.php";
$message = "";
if (isset($_GET['object'])) {
    if ($_GET['object'] == "shoutbox") {
        $object = new ShoutBox();
        $object->name = $_POST["name"];
        if (isset($_FILES['picture'])) {
            $file = new File($_FILES['picture']);
            $object->picture = $file->data;
        }
        $object->create();
        $message = "success";
    } else {
        if ($_GET['object'] == "boxsnap") {
            $object = new BoxSnap();
            $object->username = $_POST["username"];
            $object->message = $_POST["message"];
            if (isset($_FILES['picture'])) {
                $file = new File($_FILES['picture']);
                $object->picture = $file->data;
            }
            $object->create();
            $message = "success";
        } else {
            if ($_GET['object'] == "wallpost") {
                $object = new WallPost();
                $object->tousername = $_POST["tousername"];
                $object->fromusername = $_POST["fromusername"];
                $object->message = $_POST["message"];
Esempio n. 3
0
<?php

require_once "../initialize.php";
$message = "";
if (isset($_GET['object'])) {
    if (isset($_POST['id']) || isset($_GET['id'])) {
        if (isset($_POST['id']) && $_POST['id'] != "") {
            $id = $_POST['id'];
        } else {
            if (isset($_GET['id']) && $_GET['id'] != "") {
                $id = $_GET['id'];
            }
        }
        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();
Esempio n. 4
0
                 } 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";
             }
         }
     }
     $response = $objects;
 } else {
     if ($_GET['object'] == "shoutbox") {
         $sql = "SELECT * FROM " . T_SHOUTBOXES;
         $objects = ShoutBox::get_by_sql($sql);
         $filename = 0;
         if (count($objects) > 0) {
             foreach ($objects as $object) {
                 $theFile = "images/shoutboxes/" . $object->id . ".jpg";
                 if (!file_exists($theFile)) {
                     file_put_contents($theFile, base64_decode($object->picture));
                 } else {
                     if (filesize($theFile) == 0) {
                         file_put_contents($theFile, base64_decode($object->picture));
                     }
                 }
                 $object->picture = HOST . "includes/webservices/images/shoutboxes/" . $object->id . ".jpg";
             }
         }
         $response = $objects;