mirror of
https://gitlab.com/hashborgir/d2tools.git
synced 2025-10-13 08:24:24 -05:00
Light/dark theme switch
This commit is contained in:
13
index.php
13
index.php
@@ -61,13 +61,24 @@ if (!isset($_SESSION['modname']) || (!file_exists(APP_DB)) || (!file_exists($_SE
|
||||
} else {
|
||||
|
||||
PDO_Connect("sqlite:" . APP_DB);
|
||||
$sql = "SELECT * FROM D2Modder ORDER BY lastused LIMIT 1";
|
||||
$sql = "SELECT * FROM D2Modder ORDER BY lastused LIMIT 1";
|
||||
|
||||
$lastUsedMod = PDO_FetchRow($sql);
|
||||
|
||||
$_SESSION['modname'] = $lastUsedMod['modname'];
|
||||
$_SESSION['path'] = $lastUsedMod['path'];
|
||||
|
||||
$sql = "SELECT theme FROM `D2Modder` WHERE `modname`='{$_SESSION['modname']}'";
|
||||
$res = PDO_FetchAll($sql);
|
||||
|
||||
if($res[0]['theme'] == 1) {
|
||||
$css = 'dark.css';
|
||||
} else {
|
||||
$css = '';
|
||||
}
|
||||
|
||||
|
||||
|
||||
define('FILTER_PROPERTIES_FILE', 'filterProperties.txt');
|
||||
define('DB_FILE', $_SESSION['modname'] . ".db");
|
||||
define('TXT_PATH', $_SESSION['path']);
|
||||
|
Reference in New Issue
Block a user