mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 04:26:03 +00:00
D2Config lastused column added
This commit is contained in:
parent
728a398ed1
commit
3eadaac01e
@ -50,7 +50,7 @@ if (!empty($_POST)) {
|
|||||||
|
|
||||||
$modname = str_replace(' ', '', $_POST['modname']);
|
$modname = str_replace(' ', '', $_POST['modname']);
|
||||||
$_SESSION['modname'] = $modname;
|
$_SESSION['modname'] = $modname;
|
||||||
|
$time = time();
|
||||||
// write the D2Modder.db file and replace \ with \\
|
// write the D2Modder.db file and replace \ with \\
|
||||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||||
$path = rtrim($_POST['path'], "\\");
|
$path = rtrim($_POST['path'], "\\");
|
||||||
@ -60,7 +60,8 @@ if (!empty($_POST)) {
|
|||||||
PDO_Connect("sqlite:../D2Modder.db");
|
PDO_Connect("sqlite:../D2Modder.db");
|
||||||
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
|
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
|
||||||
modname VARCHAR(255),
|
modname VARCHAR(255),
|
||||||
path VARCHAR(255)
|
path VARCHAR(255),
|
||||||
|
lastused INT
|
||||||
)";
|
)";
|
||||||
PDO_Execute($sql);
|
PDO_Execute($sql);
|
||||||
|
|
||||||
@ -74,10 +75,11 @@ ERROR: INVALID PATH</h1></center>';
|
|||||||
$_SESSION['path'] = $path;
|
$_SESSION['path'] = $path;
|
||||||
// Don't yell at me, security is the least of my considerations atm
|
// Don't yell at me, security is the least of my considerations atm
|
||||||
// check modname in db
|
// check modname in db
|
||||||
$sql = "SELECT * FROM D2Modder WHERE modname='$modname'";
|
$sql = "SELECT * FROM `D2Modder` WHERE `modname`='$modname'";
|
||||||
$res = PDO_FetchAll($sql);
|
$res = PDO_FetchAll($sql);
|
||||||
|
|
||||||
if (empty($res)) {
|
if (empty($res)) {
|
||||||
$sql = "INSERT INTO D2Modder(modname,path) VALUES(\"$modname\",\"$path\")";
|
$sql = "INSERT INTO D2Modder(`modname`,`path`,`lastused`) VALUES(\"$modname\",\"$path\",$time)";
|
||||||
PDO_Execute($sql);
|
PDO_Execute($sql);
|
||||||
}
|
}
|
||||||
header("Location: /processFiles.php");
|
header("Location: /processFiles.php");
|
||||||
@ -87,7 +89,8 @@ ERROR: INVALID PATH</h1></center>';
|
|||||||
|
|
||||||
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
|
$sql = "CREATE TABLE IF NOT EXISTS D2Modder (
|
||||||
modname VARCHAR(255),
|
modname VARCHAR(255),
|
||||||
path VARCHAR(255)
|
path VARCHAR(255),
|
||||||
|
lastused INT
|
||||||
)";
|
)";
|
||||||
PDO_Execute($sql);
|
PDO_Execute($sql);
|
||||||
|
|
||||||
@ -104,10 +107,10 @@ ERROR: INVALID PATH</h1></center>';
|
|||||||
$_SESSION['path'] = $path;
|
$_SESSION['path'] = $path;
|
||||||
// Don't yell at me, security is the least of my considerations atm
|
// Don't yell at me, security is the least of my considerations atm
|
||||||
// check modname in db
|
// check modname in db
|
||||||
$sql = "SELECT * FROM D2Modder WHERE modname='$modname'";
|
$sql = "SELECT * FROM `D2Modder` WHERE modname='$modname'";
|
||||||
$res = PDO_FetchAll($sql);
|
$res = PDO_FetchAll($sql);
|
||||||
if (empty($res)) {
|
if (empty($res)) {
|
||||||
$sql = "INSERT INTO D2Modder(modname,path) VALUES(\"$modname\",\"$path\")";
|
$sql = "INSERT INTO `D2Modder` (`modname`,`path`,`lastused`) VALUES(\"$modname\",\"$path\",$time)";
|
||||||
PDO_Execute($sql);
|
PDO_Execute($sql);
|
||||||
}
|
}
|
||||||
header("Location: /processFiles.php");
|
header("Location: /processFiles.php");
|
||||||
|
Loading…
Reference in New Issue
Block a user