Place description too long, must be under 1k characters
";
}
elseif ($_POST['gdskill'][1] < 1) //cant have max players under 1
{
$alert = "
An error occurred
";
}
elseif ($_POST['gdskill'][1] > 12) //cant have max players over 12
{
$alert = "
An error occurred
";
}
elseif ($dimensionsfail)
{
$alert = "
Thumbnail resolution cannot be over 1920x1080
";
}
else //all checks passed, do the do
{
//$
//update place name
$c = $pdo->prepare("UPDATE assets SET Name = :n WHERE id = :i");
$c->bindParam(":n", cleanInput($_POST['placename']), PDO::PARAM_STR); //item name
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
// ...
//update place description
$c = $pdo->prepare("UPDATE assets SET Description = :n WHERE id = :i");
$c->bindParam(":n", cleanInput($_POST['description']), PDO::PARAM_STR); //item description
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
// ...
//update place max players
$c = $pdo->prepare("UPDATE assets SET MaxPlayers = :n WHERE id = :i");
$c->bindParam(":n", $_POST['gdskill'][1], PDO::PARAM_INT); //item price
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
// ...
if (isset($_POST['comments_checkbox']))
{
//update IsCommentsEnabled to enabled
$comments = 1;
$c = $pdo->prepare("UPDATE assets SET IsCommentsEnabled = :n, Updated = UNIX_TIMESTAMP() WHERE id = :i");
$c->bindParam(":n", $comments, PDO::PARAM_INT); //item name
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
// ...
}
else
{
//update IsCommentsEnabled to disabled
$comments = 0;
$c = $pdo->prepare("UPDATE assets SET IsCommentsEnabled = :n, Updated = UNIX_TIMESTAMP() WHERE id = :i");
$c->bindParam(":n", $comments, PDO::PARAM_INT); //item name
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
// ...
}
if (isset($_POST['thumbnail_checkbox']))
{
if (!isPlaceUsingRender($id))
{
$placepost = handleRenderPlace($id);
if ($placepost !== true) {
$alert = "
".$placepost."
";
}
else
{
redirect("config?id={$id}");
}
}
}
else
{
//grab place image hash
//files in proper places
if (!$usedefaultthumb) //if custom thumb uploaded
{
$GLOBALS['pdo']->exec("LOCK TABLES assets WRITE"); //lock since this stuff is sensitive
$b = $GLOBALS['pdo']->prepare("SELECT * FROM assets");
$b->execute();
//grab auto increment values
$autoincrement = $b->rowCount() + 1; //initial auto increment value
//add texture to assets
$assetname = $gamename . " Thumbnail";
$x = $GLOBALS['pdo']->prepare("INSERT INTO `assets`(`id`, `AssetTypeId`, `Name`, `Description`, `Created`, `Updated`, `CreatorId`, `TargetId`, `PriceInAlphabux`, `Sales`, `IsNew`, `IsForSale`, `IsPublicDomain`, `IsLimited`, `IsLimitedUnique`, `IsApproved`, `Remaining`, `MinimumMembershipLevel`, `ContentRatingTypeId`, `Favorited`, `Visited`, `MaxPlayers`, `UpVotes`, `DownVotes`, `Hash`) VALUES (:aid,1,:aname,'Place Thumbnail',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),:oid,:aid2,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,:hash)");
$x->bindParam(":aid", $autoincrement, PDO::PARAM_INT);
$x->bindParam(":aname", $assetname, PDO::PARAM_STR);
$x->bindParam(":oid", $gamecreator, PDO::PARAM_INT);
$x->bindParam(":aid2", $autoincrement, PDO::PARAM_INT);
$x->bindParam(":hash", $thumbnailHash, PDO::PARAM_STR);
$x->execute();
//update place thumbhash
$c = $pdo->prepare("UPDATE assets SET IconImageAssetId = :n WHERE id = :i");
$c->bindParam(":n", $autoincrement, PDO::PARAM_INT); //item price
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
$GLOBALS['pdo']->exec("UNLOCK TABLES");
resize(768, 432, $thumbnailuploadDirectory . $thumbnailHash, $_FILES['thumbnail_file']['tmp_name']);
setPlaceUsingCustomThumbnail($id); //set not using rendered thumb
redirect("config?id={$id}");
}
else
{
if (isPlaceUsingRender($id))
{
$thumb = rand(4, 6);
//update place icon
$c = $pdo->prepare("UPDATE assets SET IconImageAssetId = :iiad WHERE id = :i");
$c->bindParam(":iiad", $thumb, PDO::PARAM_INT); //item name
$c->bindParam(":i", $id, PDO::PARAM_INT); //catalog id
$c->execute();
// ...
setPlaceUsingCustomThumbnail($id); //set not using rendered thumb
}
redirect("config?id={$id}");
}
// ...
}
}
}
if (isset($_POST['SubmitPBSSuperflat']))
{
$upload = convertToPBSPlace("Superflat", $id);
if ($upload !== true)
{
$alert = "
" . $upload . "
";
}
else
{
$alert = "
Created Personal Server
";
}
}
if (isset($_POST['SubmitPBSRugged']))
{
$upload = convertToPBSPlace("Rugged", $id);
if ($upload !== true)
{
$alert = "
" . $upload . "
";
}
else
{
$alert = "
Created Personal Server
";
}
}
if (isset($_POST['SubmitPBSHappyHome']))
{
$upload = convertToPBSPlace("HappyHome", $id);
if ($upload !== true)
{
$alert = "
" . $upload . "
";
}
else
{
$alert = "
Created Personal Server
";
}
}
if (isset($_POST['SubmitPBSBaseplate']))
{
$upload = convertToPBSPlace("Baseplate", $id);
if ($upload !== true)
{
$alert = "
" . $upload . "
";
}
else
{
$alert = "
Created Personal Server
";
}
}
if (isset($_POST['PBSNoSelection']))
{
$alert = "
Please choose a template
";
}
if (isset($_POST['SubmitPlace']))
{
$place = newPlace();
if ($place !== true)
{
$alert = "