feat: persist display and experimental settings on the db

feat: small styles changed
This commit is contained in:
Miguel Ribeiro
2024-02-22 00:11:08 +01:00
committed by GitHub
parent 3e61711dd4
commit f0a6f1a2f1
15 changed files with 242 additions and 36 deletions
+15
View File
@@ -0,0 +1,15 @@
<?php
$query = "SELECT * FROM settings";
$result = $db->query($query);
$settings = $result->fetchArray(SQLITE3_ASSOC);
if ($settings) {
$cookieExpire = time() + (30 * 24 * 60 * 60);
setcookie('theme', $settings['dark_theme'] ? 'dark': 'light', $cookieExpire);
$settings['theme'] = $settings['dark_theme'] ? 'dark': 'light';
$settings['showMonthlyPrice'] = $settings['monthly_price'] ? 'true': 'false';
$settings['convertCurrency'] = $settings['convert_currency'] ? 'true': 'false';
$settings['removeBackground'] = $settings['remove_background'] ? 'true': 'false';
}
?>
+6 -4
View File
@@ -8,6 +8,8 @@
require_once 'i18n/getlang.php';
require_once 'i18n/' . $lang . '.php';
require_once 'getsettings.php';
require_once 'version.php';
if ($userCount == 0) {
@@ -17,8 +19,8 @@
}
$theme = "light";
if (isset($_COOKIE['theme'])) {
$theme = $_COOKIE['theme'];
if (isset($settings['theme'])) {
$theme = $settings['theme'];
}
?>
@@ -47,7 +49,7 @@
<header>
<div class="contain">
<div class="logo">
<a href=".">
<a href=".">
<div class="logo-image"></div>
</a>
</div>
@@ -58,7 +60,7 @@
<span id="user"><?= $username ?></span>
</button>
<div class="dropdown-content">
<a href="."><i class="fa-solid fa-list"></i><?= translate('subscriptions', $i18n) ?></a>
<a href="."><i class="fa-solid fa-list"></i><?= translate('subscriptions', $i18n) ?></a>
<a href="stats.php"><i class="fa-solid fa-chart-simple"></i><?= translate('stats', $i18n) ?></a>
<a href="settings.php"><i class="fa-solid fa-gear"></i><?= translate('settings', $i18n) ?></a>
<a href="about.php"><i class="fa-solid fa-info-circle"></i><?= translate('about', $i18n) ?></a>
+1 -1
View File
@@ -1,3 +1,3 @@
<?php
$version = "v1.3.0";
$version = "v1.4.0";
?>