if ($school->expireDate < time()) { include "view/expiredSchool.phtml"; exit; } if ($uri[0] == 'new') { $s = $app->db->prepare("insert into DoodleBoard (timeCreated, schoolId) values (:t,:s)"); $s->bindParam(':t', time()); $s->bindParam(':s', $school->id); $s->execute(); $newId = $app->db->lastInsertId(); header('Location: /' . $newId); exit; } $board = null; if (is_numeric($uri[0])) { $board = Whiteboard::getBySchoolId($uri[0], $school->id); } else { $board = Whiteboard::getbySchoolName($uri[0], $school->id); } if ($board) { $roomId = $board->id; $board->brandImage = $school->bgImg; $board->backgroundColor = $school->bgColor; $color = randomColor(); $inviteText = $board->getNameUrl($school->domain . ".sneffel.com"); $embedText = $board->getEmbed(500, 500, $school->domain . ".sneffel.com"); if ($board->brandImage) { $size = getimagesize("./" . $board->brandImage); $heightAdjust = $size[1] + 25; } else { $heightAdjust = 25;
<?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";