mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-09-18 01:22:08 +00:00
Item Preview Done. Todo: Stat Rendering
This commit is contained in:
@@ -55,12 +55,17 @@ if (!empty($_POST)) {
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$path = rtrim($_POST['path'], "\\");
|
||||
$path = str_replace("\\", "\\\\", $path);
|
||||
|
||||
$tbl = '\\\\data\\\\local\\\\lng\\\\eng\\\\';
|
||||
|
||||
$path .= '\\\\data\\\\global\\\\excel\\\\';
|
||||
|
||||
|
||||
PDO_Connect("sqlite:../D2Modder.db");
|
||||
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
|
||||
modname VARCHAR(255),
|
||||
path VARCHAR(255),
|
||||
tbl VARCHAR(255),
|
||||
lastused INT,
|
||||
theme INT
|
||||
)";
|
||||
@@ -74,23 +79,31 @@ ERROR: INVALID PATH</h1></center>';
|
||||
} else {
|
||||
// set this mod to active mod in session
|
||||
$_SESSION['path'] = $path;
|
||||
$_SESSION['tbl'] = $tbl;
|
||||
// Don't yell at me, security is the least of my considerations atm
|
||||
// check modname in db
|
||||
$sql = "SELECT * FROM `D2Modder` WHERE `modname`='$modname'";
|
||||
$res = PDO_FetchAll($sql);
|
||||
|
||||
if (empty($res)) {
|
||||
$sql = "INSERT INTO D2Modder(`modname`,`path`,`lastused`) VALUES(\"$modname\",\"$path\",$time)";
|
||||
$sql = "INSERT INTO D2Modder(`modname`,`path`,`tbl`,`lastused`) VALUES(\"$modname\",\"$path\",\"$tbl\",$time)";
|
||||
PDO_Execute($sql);
|
||||
}
|
||||
header("Location: /processFiles.php");
|
||||
}
|
||||
} else {
|
||||
|
||||
/*
|
||||
ELSE BLOCK FOR LINUX TESTING
|
||||
*/
|
||||
|
||||
|
||||
PDO_Connect("sqlite:../D2Modder.db");
|
||||
|
||||
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
|
||||
modname VARCHAR(255),
|
||||
path VARCHAR(255),
|
||||
tbl VARCHAR(255),
|
||||
lastused INT,
|
||||
theme INT
|
||||
)";
|
||||
@@ -107,12 +120,13 @@ ERROR: INVALID PATH</h1></center>';
|
||||
} else {
|
||||
// set this mod to active mod in session
|
||||
$_SESSION['path'] = $path;
|
||||
$_SESSION['tbl'] = $path;
|
||||
// Don't yell at me, security is the least of my considerations atm
|
||||
// check modname in db
|
||||
$sql = "SELECT * FROM `D2Modder` WHERE modname='$modname'";
|
||||
$res = PDO_FetchAll($sql);
|
||||
if (empty($res)) {
|
||||
$sql = "INSERT INTO `D2Modder` (`modname`,`path`,`lastused`) VALUES(\"$modname\",\"$path\",$time)";
|
||||
$sql = "INSERT INTO `D2Modder` (`modname`,`path`,`tbl`,`lastused`) VALUES(\"$modname\",\"$path\",\"$path\",$time)";
|
||||
PDO_Execute($sql);
|
||||
}
|
||||
header("Location: /processFiles.php");
|
||||
|
Reference in New Issue
Block a user