mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-18 01:22:08 +00:00
SetItems working. Tesing
This commit is contained in:
63
src/D2Config.php
Normal file
63
src/D2Config.php
Normal file
@@ -0,0 +1,63 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
D2UniqueMaker
|
||||
GPLv2 (C) <2021> <HashCasper>
|
||||
|
||||
This file is part of D2UM.
|
||||
|
||||
D2UM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
D2UM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with D2UM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!empty($_POST)) {
|
||||
|
||||
// write the d2um.conf file and replace \ with \\
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$path = rtrim($_POST['path'], "\\");
|
||||
$path = str_replace("\\", "\\\\", $path);
|
||||
$path .= '\\\\data\\\\global\\\\excel\\\\';
|
||||
file_put_contents("../d2um.conf", $path);
|
||||
} else {
|
||||
|
||||
file_put_contents("../d2um.conf", $_POST['path'].DIRECTORY_SEPARATOR);
|
||||
}
|
||||
|
||||
header('Location: /');
|
||||
}
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<?php
|
||||
/* Require the <head> section */
|
||||
require_once "head.php";
|
||||
?>
|
||||
<body style="text-align: center; background: white;">
|
||||
<div class="container container-top">
|
||||
<h1><img src="/img/Diablo2.png" style="float:left">D2UM: Diablo 2 Unique Maker, v2. By HashCasper</h1>
|
||||
<a class="btn" style="color:red; font-size: 18px;float:right;" href="/">X</a>
|
||||
<hr style="margin: 60px;">
|
||||
<h2>Select Mod folder</h2>
|
||||
<p style="font-family: lato">Example: D:\Diablo II\MODS\you-mod-name\</p>
|
||||
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
|
||||
|
||||
<div style="margin-top: 20px;">
|
||||
<form enctype="multipart/form-data" style="font-family: Lato; font-size: 14pt;" action="" method="post">
|
||||
<label for="path">Choose PATH</label>
|
||||
<input id="path" style="width: 420px;" required="required" name="path" type="text">
|
||||
<input type="submit" value="Save" name="submit">
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
Reference in New Issue
Block a user