From e626faf2ab30f2f2a3b230766e64e8942b0f9c40 Mon Sep 17 00:00:00 2001 From: Baoshuo Date: Tue, 7 Feb 2023 19:36:48 +0800 Subject: [PATCH] feat: fallback avatar --- web/app/controllers/problem_solutions.php | 2 +- web/app/controllers/subdomain/blog/blog.php | 2 +- web/app/controllers/subdomain/blog/index.php | 2 +- web/app/controllers/user_msg.php | 4 ++-- web/app/models/UOJRanklist.php | 2 +- web/app/views/blog-nav.php | 2 +- web/app/views/user-info.php | 2 +- web/js/uoj.js | 6 ++++++ 8 files changed, 14 insertions(+), 8 deletions(-) diff --git a/web/app/controllers/problem_solutions.php b/web/app/controllers/problem_solutions.php index 27fc649..6ace983 100644 --- a/web/app/controllers/problem_solutions.php +++ b/web/app/controllers/problem_solutions.php @@ -170,7 +170,7 @@ $pag = new Paginator($pag_config);
- + diff --git a/web/app/controllers/subdomain/blog/blog.php b/web/app/controllers/subdomain/blog/blog.php index 0cd54c6..215f90a 100644 --- a/web/app/controllers/subdomain/blog/blog.php +++ b/web/app/controllers/subdomain/blog/blog.php @@ -263,7 +263,7 @@ $comments_pag = new Paginator([
diff --git a/web/app/controllers/subdomain/blog/index.php b/web/app/controllers/subdomain/blog/index.php index a711901..22184d3 100644 --- a/web/app/controllers/subdomain/blog/index.php +++ b/web/app/controllers/subdomain/blog/index.php @@ -32,7 +32,7 @@ $all_tags = DB::selectAll("select distinct tag from blogs_tags where blog_id in pagination() ?>
- <?= UOJUserBlog::id() ?> Avatar + <?= UOJUserBlog::id() ?> Avatar
diff --git a/web/app/controllers/user_msg.php b/web/app/controllers/user_msg.php index 7c3f036..0b2934c 100644 --- a/web/app/controllers/user_msg.php +++ b/web/app/controllers/user_msg.php @@ -256,7 +256,7 @@ if (isset($_POST['user_msg'])) { '
' + '
' + - '' + + '' + '
' + '
' + '
' + @@ -290,7 +290,7 @@ if (isset($_POST['user_msg'])) { '') + '
' + '
' + - (type ? '' : '') + + (type ? '' : '') + '
' ); } diff --git a/web/app/models/UOJRanklist.php b/web/app/models/UOJRanklist.php index d356291..60cc217 100644 --- a/web/app/models/UOJRanklist.php +++ b/web/app/models/UOJRanklist.php @@ -54,7 +54,7 @@ class UOJRanklist {
- +
diff --git a/web/app/views/blog-nav.php b/web/app/views/blog-nav.php index 256be0e..3344181 100644 --- a/web/app/views/blog-nav.php +++ b/web/app/views/blog-nav.php @@ -3,7 +3,7 @@
- Logo + Logo diff --git a/web/app/views/user-info.php b/web/app/views/user-info.php index 3313c77..6cb986f 100644 --- a/web/app/views/user-info.php +++ b/web/app/views/user-info.php @@ -3,7 +3,7 @@
- Avatar of <?= $user['username'] ?> + Avatar of <?= $user['username'] ?>
diff --git a/web/js/uoj.js b/web/js/uoj.js index aeb6a77..799d258 100644 --- a/web/js/uoj.js +++ b/web/js/uoj.js @@ -1772,3 +1772,9 @@ $(document).ready(function() { ); }); }); + +$(document).ready(function() { + $('img.uoj-user-avatar').on('error', function() { + $(this).attr('src', 'data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA4NzIgODcyIj48cGF0aCBmaWxsPSIjZmZmIiBkPSJNMCAwaDg3MnY4NzJIMHoiLz48cGF0aCBmaWxsPSIjYzVjNWM1IiBkPSJNMCAwdjg3MmgxMTBhMzI3IDM4MyAwIDAxMjM2LTM0NSAxOTUgMTk1IDAgMDEtMTA0LTE3MiAxOTUgMTk1IDAgMDExOTUtMTk1IDE5NSAxOTUgMCAwMTE5NSAxOTUgMTk1IDE5NSAwIDAxLTEwNiAxNzMgMzI3IDM4MyAwIDAxMjM2IDM0NGgxMTBWMHoiLz48L3N2Zz4='); + }); +});