コード例 #1
0
    }
    $uploadName = uniqid() . '.' . $ext;
    $test = move_uploaded_file($_FILES['boardPic']['tmp_name'], fileUpload . "/" . $uploadName);
    if (!$test) {
        $imgName = "";
    } else {
        $imgName = fileUploadURLPath . "/" . $uploadName;
    }
    $size = getimagesize(fileUpload . "/" . $uploadName);
    $heightAdjust = $size[1];
}
$db = $app->db;
$newId = 0;
$boardExists = 'false';
if (array_key_exists('boardName', $_POST)) {
    $testBoard = Whiteboard::getByName($_POST['boardName'], $user->id);
    if ($testBoard) {
        $boardExists = 'true';
    }
}
if (array_key_exists('edit', $_POST) && is_numeric($_POST['edit']) && $testBoard) {
    if ($_POST['edit'] == $testBoard->id) {
        $boardExists = 'false';
    }
}
if (array_key_exists('tempId', $_GET)) {
    if (!is_numeric($_GET['tempId'])) {
        die("bad id");
    }
    $s = $db->prepare("update TempBoard set name=:n,brandImage=:b,backgroundColor=:c where id=:i and sessionId=:u");
    $s->bindParam(':i', $_GET['tempId']);
コード例 #2
0
ファイル: main.php プロジェクト: neojjang/Sneffel
<?php

$roomId = -1;
$board = null;
if (array_key_exists(0, $uri) && is_numeric($uri[0])) {
    $roomId = $uri[0];
}
if (array_key_exists(0, $uri) && $uri[0] == 'user' && array_key_exists(1, $uri) && is_numeric($uri[1])) {
    $board = Whiteboard::getByName(urldecode($uri[2]), $uri[1]);
    $roomId = $board->id;
}
/*if($roomId == -1 && array_key_exists('sneffel_board_id',$_COOKIE) && is_numeric($_COOKIE['sneffel_board_id']))
	{
		$roomId = $_COOKIE['sneffel_board_id'];
	}*/
if (array_key_exists('sneffel_replay', $_COOKIE) && $_COOKIE['sneffel_replay'] == 1) {
    setcookie('sneffel_replay', 0, time() - 3600, '/', '.sneffel.com');
    header("Location: /replay/" . $roomId);
}
$d = new MySQL();
if (!$board && $roomId > 0) {
    $board = Whiteboard::getById($roomId);
}
if ($uri[0] == 'new') {
    $d->send("insert into DoodleBoard (timeCreated,phpCreateSession,expireDate) values ('" . time() . "', '" . $user->sessionId . "','" . (time() + 60 * 60 * 3) . "') ");
    $newId = mysql_insert_id();
    header('Location: /' . $newId);
    exit;
}
if (!$board) {
    include "view/home.phtml";