mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 12:36:03 +00:00
Testing on windows
This commit is contained in:
parent
daf501785e
commit
04ddcce846
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,2 +1,3 @@
|
|||||||
db
|
*.db
|
||||||
txt/
|
txt/
|
||||||
|
txt2/
|
@ -1,2 +0,0 @@
|
|||||||
db
|
|
||||||
txt/
|
|
@ -45,7 +45,7 @@ if (file_exists("d2im.db") && (file_exists($_SESSION['modname'].".db"))){
|
|||||||
// If there's data, process it and save
|
// If there's data, process it and save
|
||||||
if (!empty($_POST)) {
|
if (!empty($_POST)) {
|
||||||
|
|
||||||
// save db name from post info conf file
|
// save db name from post into conf file
|
||||||
|
|
||||||
require_once './src/D2SaveFile.php';
|
require_once './src/D2SaveFile.php';
|
||||||
$saver = new D2SaveFile();
|
$saver = new D2SaveFile();
|
||||||
|
@ -3,7 +3,7 @@ include "includes.php";
|
|||||||
|
|
||||||
if (file_exists("d2im.db")) {
|
if (file_exists("d2im.db")) {
|
||||||
|
|
||||||
unlink(DB_FILE);
|
if(file_exists(DB_FILE)) unlink(DB_FILE);
|
||||||
|
|
||||||
$files = new D2Files();
|
$files = new D2Files();
|
||||||
$parser = new D2TxtParser();
|
$parser = new D2TxtParser();
|
||||||
|
@ -106,7 +106,7 @@ require_once "head.php";
|
|||||||
<hr style="margin: 60px;">
|
<hr style="margin: 60px;">
|
||||||
<div class="offset-2 col-8">
|
<div class="offset-2 col-8">
|
||||||
<h2>Select Mod folder</h2>
|
<h2>Select Mod folder</h2>
|
||||||
<p style="font-family: lato">Example: D:\Diablo II\MODS\you-mod-name\</p>
|
<p style="font-family: lato">Example: D:\Diablo II\MODS\your-mod-name\</p>
|
||||||
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
|
<p style="font-family: lato">Input path to D2 Mod Directory.</p>
|
||||||
|
|
||||||
<div style="margin-top: 20px;" class="ctrl-config">
|
<div style="margin-top: 20px;" class="ctrl-config">
|
||||||
|
@ -46,6 +46,7 @@ class D2Database {
|
|||||||
$tableName = basename($file);
|
$tableName = basename($file);
|
||||||
$tableName = strtolower(substr($tableName, 0, -4));
|
$tableName = strtolower(substr($tableName, 0, -4));
|
||||||
|
|
||||||
|
$sql = '';
|
||||||
foreach ($data as $d) {
|
foreach ($data as $d) {
|
||||||
$sql = "INSERT INTO `$tableName` (";
|
$sql = "INSERT INTO `$tableName` (";
|
||||||
if (!empty($d)) {
|
if (!empty($d)) {
|
||||||
|
@ -55,12 +55,11 @@ class D2TxtParser {
|
|||||||
}
|
}
|
||||||
, file($file));
|
, file($file));
|
||||||
$header = array_shift($rows);
|
$header = array_shift($rows);
|
||||||
|
$data = null;
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
$data[] = @array_combine($header, $row);
|
$data[] = @array_combine($header, $row);
|
||||||
}
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
Loading…
Reference in New Issue
Block a user