Item Preview Done. Todo: Stat Rendering

This commit is contained in:
color.diff=auto
2021-05-02 05:35:38 -06:00
parent 65b3980c44
commit efa7f8f28e
987 changed files with 816 additions and 122 deletions

View File

@@ -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");