예제 #1
0
<?php

if (!(array_key_exists('boardId', $_GET) && is_numeric($_GET['boardId']))) {
    die("invalid Board");
}
$board = Whiteboard::getById($_GET['boardId']);
if (!$board || $board->userId != $user->id) {
    die("invalid Board");
}
if ($user->credit < priceBrandBoard) {
    header("Location: /purchase?err=priceBrandBoard");
    exit;
}
if (array_key_exists('confirm', $_POST)) {
    $user->chargeCredits(priceBrandBoard);
    if ($board->expireDate < time()) {
        $s = $app->db->prepare("update DoodleBoard set expireDate = :t where id=:i");
        $time = time() + 30 * 86400;
    } else {
        $s = $app->db->prepare("update DoodleBoard set expireDate = expireDate + :t where id=:i");
        $time = 30 * 86400;
    }
    $s->bindParam(':t', $time);
    $s->bindParam(':i', $board->id);
    $s->execute();
    header("Location: /dashboard?err=Reactivate");
    exit;
}
예제 #2
0
파일: png.php 프로젝트: neojjang/Sneffel
<?php

if ($user->id < 0) {
    die("need login!");
}
ini_set("memory_limit", "64M");
if ($user->credit < priceExport) {
    die("not enough credits");
}
$user->chargeCredits(priceExport);
$boardId = $_POST['boardId'];
$board = Whiteboard::getById($boardId);
$im = $board->createPng();
if ($im) {
    header('Content-type: image/png');
    imagepng($im);
    imagedestroy($im);
    exit;
}
예제 #3
0
<?php

$roomId = is_numeric($_GET["roomId"]) ? $_GET["roomId"] : 0;
$replay = array_key_exists('replay', $_GET) ? 1 : 0;
if ($school) {
    if ($school->expireDate < time()) {
        include "view/expiredSchool.phtml";
        exit;
    }
    $board = Whiteboard::getBySchoolId($roomId, $school->id);
} else {
    $board = Whiteboard::getById($roomId);
}
$embed = 1;
if (!$board) {
    die("no board!");
}
/*if(!$replay && $board->expireDate < time())
	{
		include "view/expiredBoard.phtml";
		exit;
	}*/
if ($board->backgroundColor) {
    if ($board->brandImage) {
        $size = getimagesize("./" . $board->brandImage);
        $heightAdjust = $size[1];
    } else {
        $heightAdjust = 0;
    }
} else {
    $board->name = "www.sneffel.com";