diff --git a/web/app/controllers/add_contest.php b/web/app/controllers/add_contest.php index e23c8b7..c60cdb9 100644 --- a/web/app/controllers/add_contest.php +++ b/web/app/controllers/add_contest.php @@ -52,12 +52,12 @@ }; $time_form->succ_href="/contests"; $time_form->runAtServer(); -?> + ?>

添加比赛

printHTML(); -?> + $time_form->printHTML(); + ?>
diff --git a/web/app/controllers/announcements.php b/web/app/controllers/announcements.php index dd86797..13c3610 100644 --- a/web/app/controllers/announcements.php +++ b/web/app/controllers/announcements.php @@ -44,7 +44,7 @@ EOD; 'table_classes' => ['table', 'table-hover'], 'page_len' => 100 ]; -?> + ?>

公告

diff --git a/web/app/controllers/blog_show.php b/web/app/controllers/blog_show.php index c4ca3b9..ad1f5d1 100644 --- a/web/app/controllers/blog_show.php +++ b/web/app/controllers/blog_show.php @@ -12,4 +12,4 @@ } redirectTo(HTML::blog_url($blog['poster'], '/post/'.$_GET['id'])); -?> + ?> diff --git a/web/app/controllers/blogs.php b/web/app/controllers/blogs.php index d032ff6..d26ac36 100644 --- a/web/app/controllers/blogs.php +++ b/web/app/controllers/blogs.php @@ -29,7 +29,7 @@ EOD; $config = array(); $config['table_classes'] = array('table', 'table-hover'); -?> + ?>
diff --git a/web/app/controllers/change_user_info.php b/web/app/controllers/change_user_info.php index 06978d6..da70b78 100644 --- a/web/app/controllers/change_user_info.php +++ b/web/app/controllers/change_user_info.php @@ -58,11 +58,11 @@ if (isset($_POST['change'])) { die(handlePost()); } -?> + ?> + ?>
diff --git a/web/app/controllers/click_zan.php b/web/app/controllers/click_zan.php index e2a178f..05817fe 100644 --- a/web/app/controllers/click_zan.php +++ b/web/app/controllers/click_zan.php @@ -64,5 +64,5 @@ } $cnt = $row['zan']; } -?> + ?> \ No newline at end of file diff --git a/web/app/controllers/contest_inside.php b/web/app/controllers/contest_inside.php index bccdbd6..3dbe0ef 100644 --- a/web/app/controllers/contest_inside.php +++ b/web/app/controllers/contest_inside.php @@ -239,13 +239,13 @@ return '您尚未登录'; } switch ($_POST['rtype']) { - case 'public': - case 'private': - if (strlen($content) == 0) { - return '回复不能为空'; - } + case 'public': + case 'private': + if (strlen($content) == 0) { + return '回复不能为空'; + } break; - } + } return ''; }, null @@ -447,7 +447,7 @@ EOD; } $page_header = HTML::stripTags($contest['name']) . ' - '; -?> + ?>

@@ -462,18 +462,18 @@ EOD;
+ if ($cur_tab == 'dashboard') { + echoDashboard(); + } elseif ($cur_tab == 'submissions') { + echoMySubmissions(); + } elseif ($cur_tab == 'standings') { + echoStandings(); + } elseif ($cur_tab == 'after_contest_standings') { + echoStandings(true); + } elseif ($cur_tab == 'backstage') { + echoBackstage(); + } + ?>
@@ -485,14 +485,14 @@ EOD;
+ if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS) { + echoContestCountdown(); + } elseif ($contest['cur_progress'] <= CONTEST_TESTING) { + echoContestJudgeProgress(); + } else { + echoContestFinished(); + } + ?>
diff --git a/web/app/controllers/contest_manage.php b/web/app/controllers/contest_manage.php index 8ec7a27..3a0980b 100644 --- a/web/app/controllers/contest_manage.php +++ b/web/app/controllers/contest_manage.php @@ -166,7 +166,7 @@ $time_form->runAtServer(); $managers_form->runAtServer(); $problems_form->runAtServer(); -?> + ?>

管理

EOD; } -?> + ?>

100, - 'print_after_table' => function() { - global $myUser; - if (isSuperUser($myUser)) { - echo ''; + echoLongTable(array('*'), 'contests', "status = 'finished'", 'order by id desc', $table_header, + echoContest, + array('page_len' => 100, + 'print_after_table' => function() { + global $myUser; + if (isSuperUser($myUser)) { + echo ''; + } } - } - ) - ); -?> + ) + ); + ?> diff --git a/web/app/controllers/download.php b/web/app/controllers/download.php index dab2f2e..84bbb42 100644 --- a/web/app/controllers/download.php +++ b/web/app/controllers/download.php @@ -53,4 +53,4 @@ header("X-Sendfile: $file_name"); header("Content-type: $mimetype"); header("Content-Disposition: attachment; filename=$download_name"); -?> + ?> diff --git a/web/app/controllers/faq.php b/web/app/controllers/faq.php index b94bba5..e648444 100644 --- a/web/app/controllers/faq.php +++ b/web/app/controllers/faq.php @@ -7,7 +7,7 @@ } echoUOJPageHeader(UOJLocale::get('help')); -?> + ?>
diff --git a/web/app/controllers/forgot_pw.php b/web/app/controllers/forgot_pw.php index 510be06..357bbd4 100644 --- a/web/app/controllers/forgot_pw.php +++ b/web/app/controllers/forgot_pw.php @@ -51,7 +51,7 @@ EOD; $forgot_form->submit_button_config['align'] = 'offset'; $forgot_form->runAtServer(); -?> + ?>

请输入需要找回密码的用户名:

diff --git a/web/app/controllers/group.php b/web/app/controllers/group.php index 1b0ee0e..aabaebb 100644 --- a/web/app/controllers/group.php +++ b/web/app/controllers/group.php @@ -97,7 +97,7 @@ }; $delete_user_form->runAtServer(); } -?> + ?> @@ -109,19 +109,19 @@
    '; - echo getUserLink($ac['submitter']); - echo ' 解决了问题 '; - echo '', $ac['problem_title'], ' '; - echo ''; - echo ''; - } - if (!$current_ac) { - echo '(无)'; - } - ?> + $current_ac = queryGroupCurrentAC($group['id']); + foreach ($current_ac as $ac) { + echo '
  • '; + echo getUserLink($ac['submitter']); + echo ' 解决了问题 '; + echo '', $ac['problem_title'], ' '; + echo ''; + echo '
  • '; + } + if (!$current_ac) { + echo '(无)'; + } + ?>
diff --git a/web/app/controllers/groups.php b/web/app/controllers/groups.php index 8867a5d..8f47c6f 100644 --- a/web/app/controllers/groups.php +++ b/web/app/controllers/groups.php @@ -3,13 +3,13 @@ requirePHPLib('judger'); requirePHPLib('data'); - if (!Auth::check()) { - become403Page(UOJLocale::get('need login')); - } + if (!Auth::check()) { + become403Page(UOJLocale::get('need login')); + } - if (!isNormalUser($myUser)) { - become403Page(); - } + if (!isNormalUser($myUser)) { + become403Page(); + } if (isSuperUser($myUser)) { $new_group_form = new UOJForm('new_group'); @@ -41,12 +41,12 @@ echo ''; } -?> + ?> @@ -65,22 +65,22 @@ EOD; $from = "`groups` a left join groups_users b on a.id = b.group_id"; echoLongTable( - array('a.id as group_id', 'a.title as title', 'a.is_hidden as is_hidden', 'count(b.username) as user_count'), - $from, $cond, 'group by a.id order by a.id asc', - $header, - 'echoGroup', - array('page_len' => 100, - 'table_classes' => array('table', 'table-bordered', 'table-hover', 'table-striped'), - 'print_after_table' => function() { - global $myUser; - if (isSuperUser($myUser)) { - global $new_group_form; - $new_group_form->printHTML(); - } - }, - 'head_pagination' => true - ) - ); -?> + array('a.id as group_id', 'a.title as title', 'a.is_hidden as is_hidden', 'count(b.username) as user_count'), + $from, $cond, 'group by a.id order by a.id asc', + $header, + 'echoGroup', + array('page_len' => 100, + 'table_classes' => array('table', 'table-bordered', 'table-hover', 'table-striped'), + 'print_after_table' => function() { + global $myUser; + if (isSuperUser($myUser)) { + global $new_group_form; + $new_group_form->printHTML(); + } + }, + 'head_pagination' => true + ) + ); + ?> diff --git a/web/app/controllers/hack.php b/web/app/controllers/hack.php index d9ad3fe..d152c68 100644 --- a/web/app/controllers/hack.php +++ b/web/app/controllers/hack.php @@ -60,10 +60,10 @@ $styler->show_small_tip = false; } } -?> + ?> + ?> diff --git a/web/app/controllers/hack_list.php b/web/app/controllers/hack_list.php index 8ecb7ca..1457267 100644 --- a/web/app/controllers/hack_list.php +++ b/web/app/controllers/hack_list.php @@ -48,7 +48,7 @@ $cond = '1'; } -?> + ?>
@@ -104,6 +104,6 @@
''), $myUser); -?> + echoHacksList($cond, 'order by id desc', array('judge_time_hidden' => ''), $myUser); + ?> diff --git a/web/app/controllers/index.php b/web/app/controllers/index.php index a75a66c..a0ebfab 100644 --- a/web/app/controllers/index.php +++ b/web/app/controllers/index.php @@ -1,7 +1,7 @@ + ?>
@@ -19,11 +19,11 @@  new'; - } + $now_cnt++; + $new_tag = ''; + if ((time() - strtotime($blog['post_time'])) / 3600 / 24 <= 7) { + $new_tag = ' new'; + } ?> @@ -60,8 +60,8 @@

0): ?> diff --git a/web/app/controllers/judge/download.php b/web/app/controllers/judge/download.php index 6358ccd..4c49108 100644 --- a/web/app/controllers/judge/download.php +++ b/web/app/controllers/judge/download.php @@ -40,4 +40,4 @@ header("X-Sendfile: $file_name"); header("Content-type: $mimetype"); header("Content-Disposition: attachment; filename=$download_name"); -?> + ?> diff --git a/web/app/controllers/judge/submit.php b/web/app/controllers/judge/submit.php index 29cd2cc..f54dab6 100644 --- a/web/app/controllers/judge/submit.php +++ b/web/app/controllers/judge/submit.php @@ -209,4 +209,4 @@ } echo json_encode($submission); -?> + ?> diff --git a/web/app/controllers/judge/sync_judge_client.php b/web/app/controllers/judge/sync_judge_client.php index ba7ee51..8858ffb 100644 --- a/web/app/controllers/judge/sync_judge_client.php +++ b/web/app/controllers/judge/sync_judge_client.php @@ -18,4 +18,4 @@ } die("ok"); -?> + ?> diff --git a/web/app/controllers/login.php b/web/app/controllers/login.php index 071cd40..34485fa 100644 --- a/web/app/controllers/login.php +++ b/web/app/controllers/login.php @@ -49,10 +49,10 @@ unset($_SESSION['phrase']); die(); } -?> + ?> + ?>

diff --git a/web/app/controllers/logout.php b/web/app/controllers/logout.php index 12bfd6d..ffab348 100644 --- a/web/app/controllers/logout.php +++ b/web/app/controllers/logout.php @@ -1,7 +1,7 @@ + ?> '; + echo '
'; echo ''; echo ''; echo $header; @@ -201,5 +201,5 @@ $('#input-show_submit_mode').click(function() { } echo $pag->pagination(); -?> + ?> diff --git a/web/app/controllers/problem_statement_manage.php b/web/app/controllers/problem_statement_manage.php index 2fdf79a..b320857 100644 --- a/web/app/controllers/problem_statement_manage.php +++ b/web/app/controllers/problem_statement_manage.php @@ -53,7 +53,7 @@ }; $problem_editor->runAtServer(); -?> + ?>

# : 管理

EOD; - $countdowns_print_row = function($row) { - echo << EOD; - }; + }; $contest_submissions_deleter = new UOJForm('contest_submissions'); $contest_submissions_deleter->addInput('contest_id', 'text', '比赛ID', '', @@ -535,11 +535,11 @@ EOD; if (!isset($tabs_info[$cur_tab])) { become404Page(); } -?> + ?> + ?>
@@ -615,13 +615,13 @@ EOD; printHTML() ?> array('*'), - 'table_name' => 'custom_test_submissions', - 'cond' => '1', - 'tail' => 'order by id asc', - 'page_len' => 5 - )); + $submissions_pag = new Paginator(array( + 'col_names' => array('*'), + 'table_name' => 'custom_test_submissions', + 'cond' => '1', + 'tail' => 'order by id asc', + 'page_len' => 5 + )); foreach ($submissions_pag->get() as $submission) { $problem = queryProblemBrief($submission['problem_id']); $submission_result = json_decode($submission['result'], true); @@ -640,7 +640,7 @@ EOD; echoSubmissionContent($submission, getProblemCustomTestRequirement($problem)); echoCustomTestSubmissionDetails($submission_result['details'], "submission-{$submission['id']}-details"); } - ?> + ?> pagination() ?>
diff --git a/web/app/controllers/user_info.php b/web/app/controllers/user_info.php index 2caf43d..ff85c2d 100644 --- a/web/app/controllers/user_info.php +++ b/web/app/controllers/user_info.php @@ -10,11 +10,11 @@ $username = $_GET['username']; $REQUIRE_LIB['github_contribution_graph'] = ''; -?> + ?>
@@ -84,25 +84,25 @@
+ $result = []; + $vis = []; + while ($row = DB::fetch($_result)) { + $id = $row['date(submit_time)'] . ':' . $row['problem_id']; + if (!$vis[$id]) { + $vis[$id] = 1; + $result[strtotime($row['date(submit_time)']) * 1000]++; + } + } + ?>

EOD - ); + ); $this->is_big = true; $this->has_file = true; @@ -818,4 +818,4 @@ EOD; }; return $form; } -?> + ?> diff --git a/web/app/libs/uoj-judger-lib.php b/web/app/libs/uoj-judger-lib.php index 01c1db6..3daf884 100644 --- a/web/app/libs/uoj-judger-lib.php +++ b/web/app/libs/uoj-judger-lib.php @@ -183,4 +183,4 @@ DB::update("update problems set ac_num = (select count(*) from submissions where problem_id = problems.id and score = 100), submit_num = (select count(*) from submissions where problem_id = problems.id) where id = $problem_id"); } -?> + ?> diff --git a/web/app/libs/uoj-lib.php b/web/app/libs/uoj-lib.php index 128355c..e538a2e 100644 --- a/web/app/libs/uoj-lib.php +++ b/web/app/libs/uoj-lib.php @@ -33,4 +33,4 @@ UOJLocale::setLocale($_GET['locale']); } UOJLocale::requireModule('basic'); -?> + ?> diff --git a/web/app/models/UOJBlogEditor.php b/web/app/models/UOJBlogEditor.php index 34345be..12a8047 100644 --- a/web/app/models/UOJBlogEditor.php +++ b/web/app/models/UOJBlogEditor.php @@ -156,7 +156,7 @@ marked.setOptions({ } }) EOD - ); + ); } catch (V8JsException $e) { die(json_encode(array('content_md' => '未知错误'))); } diff --git a/web/app/views/blog-preview.php b/web/app/views/blog-preview.php index 271a739..6f6e2a4 100644 --- a/web/app/views/blog-preview.php +++ b/web/app/views/blog-preview.php @@ -13,7 +13,7 @@ $extra_text = $blog['is_hidden'] ? '[已隐藏] ' : ''; $blog_type = $blog['type'] == 'B' ? 'post' : 'slide'; -?> + ?>

By
diff --git a/web/app/views/contest-dashboard.php b/web/app/views/contest-dashboard.php index fbf0e7f..bd54c36 100644 --- a/web/app/views/contest-dashboard.php +++ b/web/app/views/contest-dashboard.php @@ -11,9 +11,9 @@
' : ''; - ?> + echo chr(ord('A') + $i); + echo ''; + ?> diff --git a/web/app/views/page-footer.php b/web/app/views/page-footer.php index e0856db..5930540 100644 --- a/web/app/views/page-footer.php +++ b/web/app/views/page-footer.php @@ -2,7 +2,7 @@ if (!isset($ShowPageFooter)) { $ShowPageFooter = true; } -?> + ?>
时间
{$row['id']} {$row['title']} {$row['endtime']}
'; - echo chr(ord('A') + $i); - echo '