diff --git a/web/app/controllers/click_zan.php b/web/app/controllers/click_zan.php index bcf1af1..4e6ed6c 100644 --- a/web/app/controllers/click_zan.php +++ b/web/app/controllers/click_zan.php @@ -21,4 +21,4 @@ if (!ClickZans::canClickZan($_POST['id'], $_POST['type'], Auth::user())) { die('
no permission
'); } -die(ClickZans::click($_POST['id'], $_POST['type'], Auth::user(), $_POST['delta'], $_POST['show-text'] !== 'false')); +die(ClickZans::click($_POST['id'], $_POST['type'], Auth::user(), $_POST['delta'])); diff --git a/web/app/controllers/problem.php b/web/app/controllers/problem.php index 1b9be67..a4a6517 100644 --- a/web/app/controllers/problem.php +++ b/web/app/controllers/problem.php @@ -379,7 +379,7 @@ if (UOJContest::cur()) { diff --git a/web/app/controllers/problem_data_manage.php b/web/app/controllers/problem_data_manage.php index 63dc15f..29f34b6 100644 --- a/web/app/controllers/problem_data_manage.php +++ b/web/app/controllers/problem_data_manage.php @@ -59,7 +59,7 @@ if ($_POST['problem_data_file_submit'] == 'submit') { if ($zip->open($up_filename) === TRUE) { $zip->extractTo("/var/uoj_data/upload/{$problem['id']}"); $zip->close(); - exec("cd /var/uoj_data/upload/{$problem['id']}; if [ -z "`find . -maxdepth 1 -type f`" ]; then for sub_dir in `find -maxdepth 1 -type d ! -name .`; do mv -f \$sub_dir/* . && rm -rf \$sub_dir; done; fi"); + exec("cd /var/uoj_data/upload/{$problem['id']}; if [ -z \"`find . -maxdepth 1 -type f`\" ]; then for sub_dir in `find -maxdepth 1 -type d ! -name .`; do mv -f \$sub_dir/* . && rm -rf \$sub_dir; done; fi"); echo ""; } else { $errmsg = "解压失败!"; @@ -749,7 +749,7 @@ $info_form->runAtServer(); diff --git a/web/app/controllers/problem_managers_manage.php b/web/app/controllers/problem_managers_manage.php index 80c1f44..53f9500 100644 --- a/web/app/controllers/problem_managers_manage.php +++ b/web/app/controllers/problem_managers_manage.php @@ -159,7 +159,7 @@ if (isSuperUser($myUser)) { diff --git a/web/app/controllers/problem_solutions.php b/web/app/controllers/problem_solutions.php index 9573abd..594457c 100644 --- a/web/app/controllers/problem_solutions.php +++ b/web/app/controllers/problem_solutions.php @@ -239,7 +239,7 @@ $pag = new Paginator($pag_config); diff --git a/web/app/controllers/problem_statement_manage.php b/web/app/controllers/problem_statement_manage.php index 1d76b47..1c67cfa 100644 --- a/web/app/controllers/problem_statement_manage.php +++ b/web/app/controllers/problem_statement_manage.php @@ -143,7 +143,7 @@ $problem_editor->runAtServer(); diff --git a/web/app/controllers/problem_statistics.php b/web/app/controllers/problem_statistics.php index c835116..468877b 100644 --- a/web/app/controllers/problem_statistics.php +++ b/web/app/controllers/problem_statistics.php @@ -315,7 +315,7 @@ $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length'] diff --git a/web/app/controllers/subdomain/blog/archive.php b/web/app/controllers/subdomain/blog/archive.php index 507cc99..72b49e2 100644 --- a/web/app/controllers/subdomain/blog/archive.php +++ b/web/app/controllers/subdomain/blog/archive.php @@ -64,7 +64,7 @@ $all_tags = DB::selectAll([ 标题 发表时间 - 评价 + 评价 @@ -85,7 +85,7 @@ $all_tags = DB::selectAll([ info['post_time'] ?> - info['id'], $blog->info['zan'], null, false) ?> + info['zan']) ?> diff --git a/web/app/models/ClickZans.php b/web/app/models/ClickZans.php index f3e66c6..8659947 100644 --- a/web/app/models/ClickZans.php +++ b/web/app/models/ClickZans.php @@ -42,7 +42,7 @@ class ClickZans { return $row['val']; } - public static function click($id, $type, $user, $delta, $show_text = true) { + public static function click($id, $type, $user, $delta) { if (!DB::$in_transaction) { return DB::transaction(fn() => ClickZans::click($id, $type, $user, $delta)); } @@ -97,14 +97,14 @@ class ClickZans { $cnt = $row['zan']; } - return ClickZans::getBlock($type, $id, $cnt, $cur, $show_text); + return ClickZans::getBlock($type, $id, $cnt, $cur); } - public static function getBlock($type, $id, $cnt, $val = null, $show_text = true) { + public static function getBlock($type, $id, $cnt, $val = null) { if ($val === null) { $val = ClickZans::query($id, $type, Auth::user()); } - return '
'; + return '
'; } public static function getCntBlock($cnt) { diff --git a/web/app/models/UOJProblem.php b/web/app/models/UOJProblem.php index d316c54..2b3e73b 100644 --- a/web/app/models/UOJProblem.php +++ b/web/app/models/UOJProblem.php @@ -107,8 +107,8 @@ class UOJProblem { return false; } - public function getZanBlock($show_text = true) { - return ClickZans::getBlock('P', $this->info['id'], $this->info['zan'], null, $show_text); + public function getZanBlock() { + return ClickZans::getBlock('P', $this->info['id'], $this->info['zan']); } public function getSubmissionRequirement() { diff --git a/web/css/uoj-bs5.css b/web/css/uoj-bs5.css index e48a45d..7836ffb 100644 --- a/web/css/uoj-bs5.css +++ b/web/css/uoj-bs5.css @@ -113,11 +113,6 @@ h6, font-size: 0.9em; } -.uoj-click-zan-block[data-show-text="1"] { - min-width: 140px; - text-align: left; -} - .uoj-click-zan-up, .uoj-click-zan-down, .uoj-click-zan-cnt { diff --git a/web/css/uoj-theme.css b/web/css/uoj-theme.css index 00ac6b6..6461a49 100644 --- a/web/css/uoj-theme.css +++ b/web/css/uoj-theme.css @@ -347,11 +347,6 @@ pre { font-size: 0.9em; } -.uoj-click-zan-block[data-show-text] { - min-width: 140px; - text-align: left; -} - .uoj-click-zan-up, .uoj-click-zan-down, .uoj-click-zan-cnt { margin-left: 5px; margin-right: 5px; diff --git a/web/js/uoj.js b/web/js/uoj.js index eaf4814..56ca444 100644 --- a/web/js/uoj.js +++ b/web/js/uoj.js @@ -263,13 +263,11 @@ $.fn.uoj_blog_tag = function() { // click zan function click_zan(zan_id, zan_type, zan_delta, node) { var loading_node = $('
loading...
'); - var show_text = Boolean($(node).data('show-text')); $(node).replaceWith(loading_node); $.post(zan_link + '/click-zan', { id : zan_id, delta : zan_delta, type : zan_type, - 'show-text': show_text, }, function(ret) { $(loading_node).replaceWith($(ret).click_zan_block()); }).fail(function() { @@ -283,7 +281,6 @@ $.fn.click_zan_block = function() { var type = $(this).data('type'); var val = parseInt($(this).data('val')); var cnt = parseInt($(this).data('cnt')); - var show_text = Boolean($(this).data('show-text')); if (isNaN(cnt)) { return; } @@ -315,11 +312,11 @@ $.fn.click_zan_block = function() { } var node = this; - var up_node = $(''+up_icon_html+(show_text ? uojLocale('click-zan::good') : '')+'').click(function(e) { + var up_node = $(''+up_icon_html+uojLocale('click-zan::good')+'').click(function(e) { e.preventDefault(); click_zan(id, type, 1, node); }).addClass(isBootstrap5Page ? 'text-decoration-none' : ''); - var down_node = $(''+down_icon_html+(show_text ? uojLocale('click-zan::bad') : '')+'').click(function(e) { + var down_node = $(''+down_icon_html+uojLocale('click-zan::bad')+'').click(function(e) { e.preventDefault(); click_zan(id, type, -1, node); }).addClass(isBootstrap5Page ? 'text-decoration-none' : '');