mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2024-11-30 04:26:03 +00:00
Mod switching fixed
This commit is contained in:
parent
ad0ed9be30
commit
13568c5b74
12
index.php
12
index.php
@ -43,28 +43,24 @@ session_start();
|
||||
|
||||
*/
|
||||
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_errors',1);
|
||||
error_reporting(E_ALL ^ E_WARNING);
|
||||
ini_set('log_errors', 0);
|
||||
ini_set('log_errors', 1);
|
||||
|
||||
include "./_pdo.php";
|
||||
|
||||
include "./config.php";
|
||||
|
||||
if (empty($_SESSION['modname'])) {
|
||||
|
||||
}
|
||||
|
||||
if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SESSION['modname'] . ".db"))) {
|
||||
// first load, no active mod, go to switchmods to select mod
|
||||
header("Location: /switchMods.php");
|
||||
} else {
|
||||
|
||||
PDO_Connect("sqlite:" . APP_DB);
|
||||
$sql = "SELECT * FROM D2Modder ORDER BY lastused LIMIT 1";
|
||||
$sql = "SELECT * FROM D2Modder ORDER BY lastused DESC LIMIT 1";
|
||||
|
||||
$lastUsedMod = PDO_FetchRow($sql);
|
||||
|
||||
|
||||
$_SESSION['modname'] = $lastUsedMod['modname'];
|
||||
$_SESSION['path'] = $lastUsedMod['path'];
|
||||
|
||||
|
@ -40,7 +40,6 @@
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
*/
|
||||
session_start();
|
||||
|
||||
require_once 'header.php'; // loads head.php inside. Further loads D2UM/SM
|
||||
require_once 'footer.php';
|
||||
|
@ -68,7 +68,8 @@ if (file_exists(APP_DB)) {
|
||||
$sql = "UPDATE `D2Modder` SET `lastused`=$time WHERE modname='{$_POST['modname']}'";
|
||||
PDO_Execute($sql);
|
||||
$_SESSION['modname'] = $mod['modname'];
|
||||
$_SESSION['path'] = $mod['path'];
|
||||
$_SESSION['path'] = $mod['path'];
|
||||
|
||||
header("Location: /");
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user