From 32659cd9e943ede9a3cfd1af3cd7d40607f91d59 Mon Sep 17 00:00:00 2001 From: danpros Date: Sun, 28 Apr 2024 11:11:50 +0700 Subject: [PATCH] Allow avatar for users --- system/admin/admin.php | 10 +++-- system/admin/views/edit-page.html.php | 56 +++++++++++++++++++++++++++ system/admin/views/layout.html.php | 3 +- system/htmly.php | 6 ++- system/includes/functions.php | 5 +++ 5 files changed, 75 insertions(+), 5 deletions(-) diff --git a/system/admin/admin.php b/system/admin/admin.php index 597fdac..159d87a 100644 --- a/system/admin/admin.php +++ b/system/admin/admin.php @@ -840,7 +840,7 @@ function edit_category($title, $url, $content, $oldfile, $destination = null, $d } // Edit user profile -function edit_profile($title, $content, $user, $description = null) +function edit_profile($title, $content, $user, $description = null, $image = null) { $description = safe_html($description); if ($description !== null) { @@ -852,8 +852,13 @@ function edit_profile($title, $content, $user, $description = null) } else { $profile_description = ""; } + if ($image !== null) { + $avatar = "\n"; + } else { + $avatar = ""; + } $user_title = safe_html($title); - $user_content = '' . $profile_description . "\n\n" . $content; + $user_content = '' . $profile_description . $avatar . "\n\n" . $content; if (!empty($user_title) && !empty($user_content)) { @@ -952,7 +957,6 @@ function delete_page($file, $destination) $deleted_content = $file; $user = $_SESSION[site_url()]['user']; $role = user('role', $user); - $arr = explode('/', $file); // realpath resolves all traversal operations like ../ $realFilePath = realpath($file); diff --git a/system/admin/views/edit-page.html.php b/system/admin/views/edit-page.html.php index 8bc142c..8ad174a 100644 --- a/system/admin/views/edit-page.html.php +++ b/system/admin/views/edit-page.html.php @@ -25,10 +25,12 @@ if ($type == 'is_frontpage') { $oldtitle = get_content_tag('t', $content, 'user'); $olddescription = get_content_tag('d', $content, remove_html_comments($content)); $oldcontent = remove_html_comments($content); + $oldimage = get_content_tag('image', $content); } else { $oldtitle = $user; $olddescription = i18n('Author_Description'); $oldcontent = i18n('Author_Description'); + $oldimage = ''; } } elseif ($type == 'is_category') { @@ -116,6 +118,20 @@ $images = image_gallery(null, 1, 40);
+ + + + +
+ +
+
+
+ + +
+ + @@ -209,10 +225,50 @@ $images = image_gallery(null, 1, 40); + + + + + + + +