mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-04-30 16:25:38 +00:00
Mod switching fixed
This commit is contained in:
parent
ad0ed9be30
commit
13568c5b74
10
index.php
10
index.php
@ -43,25 +43,21 @@ session_start();
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
ini_set('display_errors', 0);
|
ini_set('display_errors',1);
|
||||||
error_reporting(E_ALL ^ E_WARNING);
|
error_reporting(E_ALL ^ E_WARNING);
|
||||||
ini_set('log_errors', 0);
|
ini_set('log_errors', 1);
|
||||||
|
|
||||||
include "./_pdo.php";
|
include "./_pdo.php";
|
||||||
|
|
||||||
include "./config.php";
|
include "./config.php";
|
||||||
|
|
||||||
if (empty($_SESSION['modname'])) {
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SESSION['modname'] . ".db"))) {
|
if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SESSION['modname'] . ".db"))) {
|
||||||
// first load, no active mod, go to switchmods to select mod
|
// first load, no active mod, go to switchmods to select mod
|
||||||
header("Location: /switchMods.php");
|
header("Location: /switchMods.php");
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
PDO_Connect("sqlite:" . APP_DB);
|
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);
|
$lastUsedMod = PDO_FetchRow($sql);
|
||||||
|
|
||||||
|
@ -40,7 +40,6 @@
|
|||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
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 'header.php'; // loads head.php inside. Further loads D2UM/SM
|
||||||
require_once 'footer.php';
|
require_once 'footer.php';
|
||||||
|
@ -69,6 +69,7 @@ if (file_exists(APP_DB)) {
|
|||||||
PDO_Execute($sql);
|
PDO_Execute($sql);
|
||||||
$_SESSION['modname'] = $mod['modname'];
|
$_SESSION['modname'] = $mod['modname'];
|
||||||
$_SESSION['path'] = $mod['path'];
|
$_SESSION['path'] = $mod['path'];
|
||||||
|
|
||||||
header("Location: /");
|
header("Location: /");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user