Public: stacked before/after and editable welcome text; admin media/comments mode polish

This commit is contained in:
Alex Assistant
2026-02-20 15:08:13 +03:00
parent f97064ab8b
commit 0e357c0e42
4 changed files with 43 additions and 3 deletions
+18
View File
@@ -155,3 +155,21 @@ function commentsLatest(int $limit = 100): array
LIMIT ' . (int)$limit;
return db()->query($sql)->fetchAll();
}
function settingGet(string $key, string $default = ''): string
{
try {
$st = db()->prepare('SELECT `value` FROM site_settings WHERE `key`=:k');
$st->execute(['k' => $key]);
$v = $st->fetchColumn();
return is_string($v) ? $v : $default;
} catch (Throwable) {
return $default;
}
}
function settingSet(string $key, string $value): void
{
$st = db()->prepare('INSERT INTO site_settings(`key`,`value`) VALUES (:k,:v) ON DUPLICATE KEY UPDATE `value`=VALUES(`value`)');
$st->execute(['k' => $key, 'v' => $value]);
}