Skip to content

Commit

Permalink
Update new-modpack.php
Browse files Browse the repository at this point in the history
  • Loading branch information
cowpod committed Nov 10, 2024
1 parent 000c1c5 commit f510be1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion functions/new-modpack.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
}

$mpq = $db->query("SELECT COUNT(*) AS count FROM `modpacks` WHERE name LIKE 'unnamed-modpack-%'");
$mpi = $mpq[0]['count']+1;
$mpi = ($mpq && isset($mpq[0]['count'])) ? $mpq[0]['count']+1 : 1;

$db->execute("INSERT INTO modpacks(`name`,`display_name`,`icon`,`icon_md5`,`logo`,`logo_md5`,`background`,`background_md5`,`public`) VALUES ('unnamed-modpack-".$mpi."','Unnamed modpack','http://".$config['host'].$config['dir']."resources/default/icon.png','A5EA4C8FA53984C911A1B52CA31BC008','http://".$config['host'].$config['dir']."resources/default/logo.png','70A114D55FF1FA4C5EEF7F2FDEEB7D03','http://".$config['host'].$config['dir']."resources/default/background.png','88F838780B89D7C7CD10FE6C3DBCDD39',1)");

Expand Down

0 comments on commit f510be1

Please sign in to comment.