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';
}
?>