From 18c02a60d2d3ecce0a0838d1bb79b2fdd46be07c Mon Sep 17 00:00:00 2001 From: Henry Gross-Hellsen <6283258+cowpod@users.noreply.github.com> Date: Tue, 29 Oct 2024 00:04:18 -0700 Subject: [PATCH] index.php/builds: set loadertype on update --- index.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index 5237dbf..ad5a015 100644 --- a/index.php +++ b/index.php @@ -1169,6 +1169,8 @@ function uri($uri) { unset($modslist[0]); } + // update build details + // todo: move this to it's own function and set form action to that. if (isset($_POST['java'])) { if ($_POST['forgec']!=="none"||empty($modslist)) { if ($_POST['forgec']=="wipe"||empty($modslist)) { @@ -1188,7 +1190,9 @@ function uri($uri) { assert(sizeof($minecraft)==1); $minecraft=$minecraft[0]; } - $db->execute("UPDATE `builds` SET `minecraft` = '".$minecraft['mcversion']."', `java` = '".$db->sanitize($_POST['java'])."', `memory` = '".$db->sanitize($_POST['memory'])."', `public` = ".$ispublic." WHERE `id` = ".$db->sanitize($_GET['id'])); + + $db->execute("UPDATE `builds` SET `minecraft` = '".$minecraft['mcversion']."', `java` = '".$db->sanitize($_POST['java'])."', `memory` = '".$db->sanitize($_POST['memory'])."', `public` = ".$ispublic.", `loadertype` = '".$minecraft['loadertype']."' WHERE `id` = ".$db->sanitize($_GET['id'])); + $latest_public = $db->query("SELECT `name`,`modpack`,`public` FROM `builds` WHERE `public` = 1 AND `modpack` = ".$user['modpack']." ORDER BY `id` DESC"); if ($latest_public) { assert(sizeof($latest_public==1));