Commit 3432eb36 authored by Mahmoud Aglan's avatar Mahmoud Aglan

fix: admin branding page now shows uploaded assets — load from platform_assets table

The admin was only reading from local theme.json and platform_theme,
but uploaded emoji/asset URLs are stored in platform_assets. Now loads
them on page render so the preview thumbnails actually appear.
Co-Authored-By: 's avatarClaude Opus 4.6 <noreply@anthropic.com>
parent c7c76636
...@@ -34,6 +34,16 @@ if (is_array($themeRows) && !isset($themeRows['error'])) { ...@@ -34,6 +34,16 @@ if (is_array($themeRows) && !isset($themeRows['error'])) {
$theme[$row['id']] = $row['value']; $theme[$row['id']] = $row['value'];
} }
} }
// Load assets from platform_assets table
$assetRows = $sdb->get('platform_assets', ['select' => 'id,asset_url']);
if (is_array($assetRows) && !isset($assetRows['error'])) {
if (!isset($theme['assets'])) $theme['assets'] = [];
foreach ($assetRows as $row) {
if ($row['asset_url']) {
$theme['assets'][$row['id']] = $row['asset_url'];
}
}
}
// Merge local file on top (for assets that are still local) // Merge local file on top (for assets that are still local)
if (file_exists($THEME_FILE)) { if (file_exists($THEME_FILE)) {
$localTheme = json_decode(file_get_contents($THEME_FILE), true) ?: []; $localTheme = json_decode(file_get_contents($THEME_FILE), true) ?: [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment