From e51e26cd0c39d7f284c640bc9e51bfbc1283d843 Mon Sep 17 00:00:00 2001 From: Jan BELLON Date: Fri, 8 Mar 2024 17:51:31 +0000 Subject: [PATCH] Update 13 files - /include/variables.php - /include/functions.php - /config/global.ini - /html/about.php - /html/admin.php - /html/compte.php - /html/editpage.php - /html/index.php - /html/login.php - /html/news.php - /html/register.php - /html/upload.php - /html/users.php --- config/global.ini | 6 +++++- html/about.php | 2 +- html/admin.php | 2 +- html/compte.php | 2 +- html/editpage.php | 2 +- html/index.php | 2 +- html/login.php | 2 +- html/news.php | 2 +- html/register.php | 2 +- html/upload.php | 2 +- html/users.php | 2 +- include/functions.php | 8 ++++++-- include/variables.php | 1 + 13 files changed, 22 insertions(+), 13 deletions(-) diff --git a/config/global.ini b/config/global.ini index f4b0564e..021ebc48 100644 --- a/config/global.ini +++ b/config/global.ini @@ -24,4 +24,8 @@ A propos = "about.php" 0 = "Invité" 1 = "Membre" 2 = "Responsable" -3 = "Directeur" \ No newline at end of file +3 = "Directeur" + +[themes] +0 = 'dark' +1 = 'light' \ No newline at end of file diff --git a/html/about.php b/html/about.php index ec120d50..88d18e67 100644 --- a/html/about.php +++ b/html/about.php @@ -12,7 +12,7 @@ require "../include/functions.php"; <?=$title?> -'> +'>
diff --git a/html/admin.php b/html/admin.php index bdf500be..a132803d 100644 --- a/html/admin.php +++ b/html/admin.php @@ -18,7 +18,7 @@ if($_SESSION['role'] < 3) { <?=$title?> -'> +'>
diff --git a/html/compte.php b/html/compte.php index 285527c3..aa3e6d12 100644 --- a/html/compte.php +++ b/html/compte.php @@ -31,7 +31,7 @@ if(isset($_POST['delete_account'])) { <?=$title?> -'> +'>
diff --git a/html/editpage.php b/html/editpage.php index 01d90993..b5e9cdd9 100644 --- a/html/editpage.php +++ b/html/editpage.php @@ -70,7 +70,7 @@ if(isset($fichier)) { } -'> +'>
diff --git a/html/index.php b/html/index.php index 8bff61a7..dee06b9c 100644 --- a/html/index.php +++ b/html/index.php @@ -12,7 +12,7 @@ require "../include/functions.php"; <?=$title?> -'> +'>
diff --git a/html/login.php b/html/login.php index b1f1ad4b..fb885f5f 100644 --- a/html/login.php +++ b/html/login.php @@ -43,7 +43,7 @@ if(isset($_POST['username']) && isset($_POST['password'])) { <?=$title?> -'> +'>
diff --git a/html/news.php b/html/news.php index 5db9d62e..a19d3bf6 100644 --- a/html/news.php +++ b/html/news.php @@ -17,7 +17,7 @@ if (filter_var($_GET['article'], FILTER_VALIDATE_INT)) { <?=$title?> -'> +'>
diff --git a/html/register.php b/html/register.php index 12467cee..46ea3596 100644 --- a/html/register.php +++ b/html/register.php @@ -43,7 +43,7 @@ if(isset($_POST['username']) && isset($_POST['password']) && isset($_POST['passw <?=$title?> -'> +'>
diff --git a/html/upload.php b/html/upload.php index 96457121..3b72ac78 100644 --- a/html/upload.php +++ b/html/upload.php @@ -47,7 +47,7 @@ if(isset($_POST['page-content'])) { } -'> +'>
diff --git a/html/users.php b/html/users.php index 44152c34..92f0f7fe 100644 --- a/html/users.php +++ b/html/users.php @@ -32,7 +32,7 @@ if(isset($_POST['userid']) && isset($_POST['role']) && isset($_POST['accreditati <?=$title?> -'> +'>
diff --git a/include/functions.php b/include/functions.php index 90c4794c..89b7d0cd 100644 --- a/include/functions.php +++ b/include/functions.php @@ -9,8 +9,12 @@ if(!isset($_SESSION['role'])) { $_SESSION['role'] = 0; } -if(!isset($_SESSION['colormode'])) { - $_SESSION['colormode'] = "dark"; +if(!isset($_SESSION['theme'])) { + $_SESSION['theme'] = $themes[0]; +} + +if(isset($_GET['theme'])) { + $_SESSION['theme'] = $themes[$_SESSION['theme'] % 2]; } function nav($nav) { diff --git a/include/variables.php b/include/variables.php index 03b567e2..5a6cb80f 100644 --- a/include/variables.php +++ b/include/variables.php @@ -15,4 +15,5 @@ $navadmin = $nav; $status = ""; $classifications = $config['classifications']; $roles = $config['roles']; +$themes = $config['themes']; ?> \ No newline at end of file