add user banners :)

This commit is contained in:
2026-07-16 07:22:03 +02:00
parent 41ac99cd5c
commit 1a99e58d84
10 changed files with 765 additions and 5 deletions

View File

@@ -23,9 +23,9 @@ export default (router, tpl) => {
join tags t on t.id = et.id
`;
// Get custom avatar file if exists
// Get custom avatar file and banner file if exists
const userOptions = (await db`
select avatar_file from user_options where user_id = ${+req.session.id}
select avatar_file, banner_file from user_options where user_id = ${+req.session.id}
`)[0];
// Get full user info
@@ -46,8 +46,10 @@ export default (router, tpl) => {
sessions,
excluded_tags: excluded_tags || [],
avatar_file: userOptions?.avatar_file || null,
banner_file: userOptions?.banner_file || null,
email: user?.email || '',
joined: user?.created_at || null,
user_banner_enabled: cfg.websrv.user_banner_enabled !== false,
enable_swf: cfg.enable_swf,
enable_data_export: cfg.websrv.enable_data_export,
enable_user_api_keys: cfg.websrv.enable_user_api_keys !== false,