From 6b08b62510584471a6cbcf90556a601e49640737 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 22 May 2024 21:20:46 +0200 Subject: [PATCH] not showing admin and username seleciton to user it wont do anything so yk --- res/forum/script.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/res/forum/script.js b/res/forum/script.js index b129dcb..55f1cea 100644 --- a/res/forum/script.js +++ b/res/forum/script.js @@ -31,8 +31,10 @@ function selection(type, value) }); } -function inject_info(id, username, postfix) +async function inject_info(id, username, postfix) { + let am_i_admin = await is_admin(); + $.ajax ({ url: "./res/forum/api/user_info.php?username=" + username, @@ -42,10 +44,10 @@ function inject_info(id, username, postfix) let sex_select = await selection("sex", result.sex); let output = - `Uživatelské jméno:
- Přezdívka:
- Admin: ${admin_select}
- Pohlaví: ${sex_select}
+ ((am_i_admin) ? `Uživatelské jméno:
` : ``) + + `Přezdívka:
` + + ((am_i_admin) ? `Admin: ${admin_select}
` : ``) + + `Pohlaví: ${sex_select}
Bio:
`; $(id).html(output + postfix);