fix: style

This commit is contained in:
Baoshuo Ren 2022-09-18 12:58:35 +08:00
parent df203c3375
commit 410631075e
Signed by: baoshuo
GPG Key ID: 00CB9680AB29F51A
58 changed files with 293 additions and 294 deletions

View File

@ -52,12 +52,12 @@
}; };
$time_form->succ_href="/contests"; $time_form->succ_href="/contests";
$time_form->runAtServer(); $time_form->runAtServer();
?> ?>
<?php echoUOJPageHeader('添加比赛') ?> <?php echoUOJPageHeader('添加比赛') ?>
<h1 class="page-header">添加比赛</h1> <h1 class="page-header">添加比赛</h1>
<div class="tab-pane active" id="tab-time"> <div class="tab-pane active" id="tab-time">
<?php <?php
$time_form->printHTML(); $time_form->printHTML();
?> ?>
</div> </div>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -44,7 +44,7 @@ EOD;
'table_classes' => ['table', 'table-hover'], 'table_classes' => ['table', 'table-hover'],
'page_len' => 100 'page_len' => 100
]; ];
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('announcements')) ?> <?php echoUOJPageHeader(UOJLocale::get('announcements')) ?>
<h3>公告</h3> <h3>公告</h3>
<?php echoLongTable(array('blogs.id', 'poster', 'title', 'post_time', 'zan', 'level'), 'important_blogs, blogs', 'is_hidden = 0 and important_blogs.blog_id = blogs.id', 'order by level desc, important_blogs.blog_id desc', $header, 'echoBlogCell', $config); ?> <?php echoLongTable(array('blogs.id', 'poster', 'title', 'post_time', 'zan', 'level'), 'important_blogs, blogs', 'is_hidden = 0 and important_blogs.blog_id = blogs.id', 'order by level desc, important_blogs.blog_id desc', $header, 'echoBlogCell', $config); ?>

View File

@ -12,4 +12,4 @@
} }
redirectTo(HTML::blog_url($blog['poster'], '/post/'.$_GET['id'])); redirectTo(HTML::blog_url($blog['poster'], '/post/'.$_GET['id']));
?> ?>

View File

@ -29,7 +29,7 @@
EOD; EOD;
$config = array(); $config = array();
$config['table_classes'] = array('table', 'table-hover'); $config['table_classes'] = array('table', 'table-hover');
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('blogs')) ?> <?php echoUOJPageHeader(UOJLocale::get('blogs')) ?>
<?php if (Auth::check()): ?> <?php if (Auth::check()): ?>
<div class="float-right"> <div class="float-right">

View File

@ -58,11 +58,11 @@
if (isset($_POST['change'])) { if (isset($_POST['change'])) {
die(handlePost()); die(handlePost());
} }
?> ?>
<?php <?php
$REQUIRE_LIB['dialog'] = ''; $REQUIRE_LIB['dialog'] = '';
$REQUIRE_LIB['md5'] = ''; $REQUIRE_LIB['md5'] = '';
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('modify my profile')) ?> <?php echoUOJPageHeader(UOJLocale::get('modify my profile')) ?>
<h2 class="page-header"><?= UOJLocale::get('modify my profile') ?></h2> <h2 class="page-header"><?= UOJLocale::get('modify my profile') ?></h2>
<form id="form-update" class="form-horizontal"> <form id="form-update" class="form-horizontal">

View File

@ -64,5 +64,5 @@
} }
$cnt = $row['zan']; $cnt = $row['zan'];
} }
?> ?>
<?= getClickZanBlock($type, $id, $cnt, $cur) ?> <?= getClickZanBlock($type, $id, $cnt, $cur) ?>

View File

@ -239,13 +239,13 @@
return '您尚未登录'; return '您尚未登录';
} }
switch ($_POST['rtype']) { switch ($_POST['rtype']) {
case 'public': case 'public':
case 'private': case 'private':
if (strlen($content) == 0) { if (strlen($content) == 0) {
return '回复不能为空'; return '回复不能为空';
} }
break; break;
} }
return ''; return '';
}, },
null null
@ -447,7 +447,7 @@ EOD;
} }
$page_header = HTML::stripTags($contest['name']) . ' - '; $page_header = HTML::stripTags($contest['name']) . ' - ';
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - ' . $tabs_info[$cur_tab]['name'] . ' - ' . UOJLocale::get('contests::contest')) ?> <?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - ' . $tabs_info[$cur_tab]['name'] . ' - ' . UOJLocale::get('contests::contest')) ?>
<div class="text-center"> <div class="text-center">
<h1><?= $contest['name'] ?></h1> <h1><?= $contest['name'] ?></h1>
@ -462,18 +462,18 @@ EOD;
<?= HTML::tablist($tabs_info, $cur_tab) ?> <?= HTML::tablist($tabs_info, $cur_tab) ?>
<div class="top-buffer-md"> <div class="top-buffer-md">
<?php <?php
if ($cur_tab == 'dashboard') { if ($cur_tab == 'dashboard') {
echoDashboard(); echoDashboard();
} elseif ($cur_tab == 'submissions') { } elseif ($cur_tab == 'submissions') {
echoMySubmissions(); echoMySubmissions();
} elseif ($cur_tab == 'standings') { } elseif ($cur_tab == 'standings') {
echoStandings(); echoStandings();
} elseif ($cur_tab == 'after_contest_standings') { } elseif ($cur_tab == 'after_contest_standings') {
echoStandings(true); echoStandings(true);
} elseif ($cur_tab == 'backstage') { } elseif ($cur_tab == 'backstage') {
echoBackstage(); echoBackstage();
} }
?> ?>
</div> </div>
</div> </div>
@ -485,14 +485,14 @@ EOD;
<div class="col-sm-3"> <div class="col-sm-3">
<?php <?php
if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS) { if ($contest['cur_progress'] <= CONTEST_IN_PROGRESS) {
echoContestCountdown(); echoContestCountdown();
} elseif ($contest['cur_progress'] <= CONTEST_TESTING) { } elseif ($contest['cur_progress'] <= CONTEST_TESTING) {
echoContestJudgeProgress(); echoContestJudgeProgress();
} else { } else {
echoContestFinished(); echoContestFinished();
} }
?> ?>
<?php if ($cur_tab == 'standings' || $cur_tab == 'after_contest_standings'): ?> <?php if ($cur_tab == 'standings' || $cur_tab == 'after_contest_standings'): ?>
</div> </div>
<div class="col-sm-3"> <div class="col-sm-3">

View File

@ -166,7 +166,7 @@
$time_form->runAtServer(); $time_form->runAtServer();
$managers_form->runAtServer(); $managers_form->runAtServer();
$problems_form->runAtServer(); $problems_form->runAtServer();
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - 比赛管理') ?> <?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - 比赛管理') ?>
<h1 class="page-header" align="center"><?=$contest['name']?> 管理</h1> <h1 class="page-header" align="center"><?=$contest['name']?> 管理</h1>
<ul class="nav nav-tabs mb-3" role="tablist"> <ul class="nav nav-tabs mb-3" role="tablist">
@ -193,13 +193,13 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
$row_id = 0; $row_id = 0;
$result = DB::query("select username from contests_permissions where contest_id = {$contest['id']}"); $result = DB::query("select username from contests_permissions where contest_id = {$contest['id']}");
while ($row = DB::fetch($result, MYSQLI_ASSOC)) { while ($row = DB::fetch($result, MYSQLI_ASSOC)) {
$row_id++; $row_id++;
echo '<tr>', '<td>', $row_id, '</td>', '<td>', getUserLink($row['username']), '</td>', '</tr>'; echo '<tr>', '<td>', $row_id, '</td>', '<td>', getUserLink($row['username']), '</td>', '</tr>';
} }
?> ?>
</tbody> </tbody>
</table> </table>
<p class="text-center">命令格式:命令一行一个,+mike表示把mike加入管理者-mike表示把mike从管理者中移除</p> <p class="text-center">命令格式:命令一行一个,+mike表示把mike加入管理者-mike表示把mike从管理者中移除</p>
@ -216,13 +216,13 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
$result = DB::query("select problem_id from contests_problems where contest_id = ${contest['id']} order by dfn asc"); $result = DB::query("select problem_id from contests_problems where contest_id = ${contest['id']} order by dfn asc");
while ($row = DB::fetch($result, MYSQLI_ASSOC)) { while ($row = DB::fetch($result, MYSQLI_ASSOC)) {
$problem = queryProblemBrief($row['problem_id']); $problem = queryProblemBrief($row['problem_id']);
$problem_config_str = isset($contest['extra_config']["problem_{$problem['id']}"]) ? $contest['extra_config']["problem_{$problem['id']}"] : 'sample'; $problem_config_str = isset($contest['extra_config']["problem_{$problem['id']}"]) ? $contest['extra_config']["problem_{$problem['id']}"] : 'sample';
echo '<tr>', '<td>', $problem['id'], '</td>', '<td>', getProblemLink($problem), ' ', "[$problem_config_str]", '</td>', '</tr>'; echo '<tr>', '<td>', $problem['id'], '</td>', '<td>', getProblemLink($problem), ' ', "[$problem_config_str]", '</td>', '</tr>';
} }
?> ?>
</tbody> </tbody>
</table> </table>
<p class="text-center">命令格式:命令一行一个,+233表示把题号为233的试题加入比赛-233表示把题号为233的试题从比赛中移除</p> <p class="text-center">命令格式:命令一行一个,+233表示把题号为233的试题加入比赛-233表示把题号为233的试题从比赛中移除</p>

View File

@ -106,7 +106,7 @@
$unregister_form->runAtServer(); $unregister_form->runAtServer();
} }
} }
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - ' . UOJLocale::get('contests::contest registrants')) ?> <?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - ' . UOJLocale::get('contests::contest registrants')) ?>
<h1 class="text-center"><?= $contest['name'] ?></h1> <h1 class="text-center"><?= $contest['name'] ?></h1>
@ -123,55 +123,55 @@
<?php endif ?> <?php endif ?>
<?php <?php
if ($show_ip) { if ($show_ip) {
$header_row = '<tr><th>#</th><th>'.UOJLocale::get('username').'</th><th>remote_addr</th></tr>'; $header_row = '<tr><th>#</th><th>'.UOJLocale::get('username').'</th><th>remote_addr</th></tr>';
$ip_owner = array(); $ip_owner = array();
foreach (DB::selectAll("select * from contests_registrants where contest_id = {$contest['id']} order by username desc") as $reg) { foreach (DB::selectAll("select * from contests_registrants where contest_id = {$contest['id']} order by username desc") as $reg) {
$user = queryUser($reg['username']); $user = queryUser($reg['username']);
$ip_owner[$user['remote_addr']] = $reg['username']; $ip_owner[$user['remote_addr']] = $reg['username'];
}
} else {
$header_row = '<tr><th>#</th><th>'.UOJLocale::get('username').'</th></tr>';
} }
} else {
$header_row = '<tr><th>#</th><th>'.UOJLocale::get('username').'</th></tr>';
}
echoLongTable(array('*'), 'contests_registrants', "contest_id = {$contest['id']}", 'order by username desc', echoLongTable(array('*'), 'contests_registrants', "contest_id = {$contest['id']}", 'order by username desc',
$header_row, $header_row,
function($contest, $num) { function($contest, $num) {
global $myUser; global $myUser;
global $show_ip, $ip_owner; global $show_ip, $ip_owner;
$user = queryUser($contest['username']); $user = queryUser($contest['username']);
$user_link = getUserLink($contest['username']); $user_link = getUserLink($contest['username']);
if (!$show_ip) { if (!$show_ip) {
echo '<tr>';
} else {
if ($ip_owner[$user['remote_addr']] != $user['username']) {
echo '<tr class="danger">';
} else {
echo '<tr>'; echo '<tr>';
} else {
if ($ip_owner[$user['remote_addr']] != $user['username']) {
echo '<tr class="danger">';
} else {
echo '<tr>';
}
} }
} echo '<td>'.$num.'</td>';
echo '<td>'.$num.'</td>'; echo '<td>'.$user_link.'</td>';
echo '<td>'.$user_link.'</td>'; if ($show_ip) {
if ($show_ip) { echo '<td>'.$user['remote_addr'].'</td>';
echo '<td>'.$user['remote_addr'].'</td>'; }
} echo '</tr>';
echo '</tr>'; },
}, array('page_len' => 100,
array('page_len' => 100, 'get_row_index' => '',
'get_row_index' => '', 'print_after_table' => function() {
'print_after_table' => function() { global $add_new_contestant_form, $add_group_to_contest_form;
global $add_new_contestant_form, $add_group_to_contest_form;
if (isset($add_new_contestant_form)) { if (isset($add_new_contestant_form)) {
$add_new_contestant_form->printHTML(); $add_new_contestant_form->printHTML();
}
if (isset($add_group_to_contest_form)) {
$add_group_to_contest_form->printHTML();
}
} }
if (isset($add_group_to_contest_form)) { )
$add_group_to_contest_form->printHTML(); );
} ?>
}
)
);
?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -28,7 +28,7 @@
$register_form->succ_href = "/contests"; $register_form->succ_href = "/contests";
$register_form->runAtServer(); $register_form->runAtServer();
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - 报名') ?> <?php echoUOJPageHeader(HTML::stripTags($contest['name']) . ' - 报名') ?>
<h1 class="page-header">比赛规则</h1> <h1 class="page-header">比赛规则</h1>
<ul> <ul>

View File

@ -48,11 +48,11 @@ EOD;
echo '<td>', '<div class="text-left">'.$click_zan_block.'</div>', '</td>'; echo '<td>', '<div class="text-left">'.$click_zan_block.'</div>', '</td>';
echo '</tr>'; echo '</tr>';
} }
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('contests')) ?> <?php echoUOJPageHeader(UOJLocale::get('contests')) ?>
<h4><?= UOJLocale::get('contests::current or upcoming contests') ?></h4> <h4><?= UOJLocale::get('contests::current or upcoming contests') ?></h4>
<?php <?php
$table_header = ''; $table_header = '';
$table_header .= '<tr>'; $table_header .= '<tr>';
$table_header .= '<th>'.UOJLocale::get('contests::contest name').'</th>'; $table_header .= '<th>'.UOJLocale::get('contests::contest name').'</th>';
$table_header .= '<th style="width:15em;">'.UOJLocale::get('contests::start time').'</th>'; $table_header .= '<th style="width:15em;">'.UOJLocale::get('contests::start time').'</th>';
@ -81,22 +81,22 @@ $('#contest-countdown').countdown($rest_second, function() {
</div> </div>
EOD; EOD;
} }
?> ?>
<h4><?= UOJLocale::get('contests::ended contests') ?></h4> <h4><?= UOJLocale::get('contests::ended contests') ?></h4>
<?php <?php
echoLongTable(array('*'), 'contests', "status = 'finished'", 'order by id desc', $table_header, echoLongTable(array('*'), 'contests', "status = 'finished'", 'order by id desc', $table_header,
echoContest, echoContest,
array('page_len' => 100, array('page_len' => 100,
'print_after_table' => function() { 'print_after_table' => function() {
global $myUser; global $myUser;
if (isSuperUser($myUser)) { if (isSuperUser($myUser)) {
echo '<div class="text-right">'; echo '<div class="text-right">';
echo '<a href="/contest/new" class="btn btn-primary">'.UOJLocale::get('contests::add new contest').'</a>'; echo '<a href="/contest/new" class="btn btn-primary">'.UOJLocale::get('contests::add new contest').'</a>';
echo '</div>'; echo '</div>';
}
} }
} )
) );
); ?>
?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -53,4 +53,4 @@
header("X-Sendfile: $file_name"); header("X-Sendfile: $file_name");
header("Content-type: $mimetype"); header("Content-type: $mimetype");
header("Content-Disposition: attachment; filename=$download_name"); header("Content-Disposition: attachment; filename=$download_name");
?> ?>

View File

@ -7,7 +7,7 @@
} }
echoUOJPageHeader(UOJLocale::get('help')); echoUOJPageHeader(UOJLocale::get('help'));
?> ?>
<article> <article>
<header> <header>
<h2 class="page-header">常见问题及其解答(FAQ)</h2> <h2 class="page-header">常见问题及其解答(FAQ)</h2>

View File

@ -51,7 +51,7 @@ EOD;
$forgot_form->submit_button_config['align'] = 'offset'; $forgot_form->submit_button_config['align'] = 'offset';
$forgot_form->runAtServer(); $forgot_form->runAtServer();
?> ?>
<?php echoUOJPageHeader('找回密码') ?> <?php echoUOJPageHeader('找回密码') ?>
<h2 class="page-header">找回密码</h2> <h2 class="page-header">找回密码</h2>
<h4>请输入需要找回密码的用户名:</h4> <h4>请输入需要找回密码的用户名:</h4>

View File

@ -97,7 +97,7 @@
}; };
$delete_user_form->runAtServer(); $delete_user_form->runAtServer();
} }
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('groups')) ?> <?php echoUOJPageHeader(UOJLocale::get('groups')) ?>
@ -109,19 +109,19 @@
<h5><?= UOJLocale::get('news') ?></h5> <h5><?= UOJLocale::get('news') ?></h5>
<ul> <ul>
<?php <?php
$current_ac = queryGroupCurrentAC($group['id']); $current_ac = queryGroupCurrentAC($group['id']);
foreach ($current_ac as $ac) { foreach ($current_ac as $ac) {
echo '<li>'; echo '<li>';
echo getUserLink($ac['submitter']); echo getUserLink($ac['submitter']);
echo ' 解决了问题 '; echo ' 解决了问题 ';
echo '<a href="/problem/', $ac['problem_id'], '">', $ac['problem_title'], '</a> '; echo '<a href="/problem/', $ac['problem_id'], '">', $ac['problem_title'], '</a> ';
echo '<time class="time">(', $ac['submit_time'], ')</time>'; echo '<time class="time">(', $ac['submit_time'], ')</time>';
echo '</li>'; echo '</li>';
} }
if (!$current_ac) { if (!$current_ac) {
echo '(无)'; echo '(无)';
} }
?> ?>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -3,13 +3,13 @@
requirePHPLib('judger'); requirePHPLib('judger');
requirePHPLib('data'); requirePHPLib('data');
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); become403Page(UOJLocale::get('need login'));
} }
if (!isNormalUser($myUser)) { if (!isNormalUser($myUser)) {
become403Page(); become403Page();
} }
if (isSuperUser($myUser)) { if (isSuperUser($myUser)) {
$new_group_form = new UOJForm('new_group'); $new_group_form = new UOJForm('new_group');
@ -41,12 +41,12 @@
echo '</tr>'; echo '</tr>';
} }
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('groups')) ?> <?php echoUOJPageHeader(UOJLocale::get('groups')) ?>
<?php <?php
$groups_caption = UOJLocale::get('groups'); $groups_caption = UOJLocale::get('groups');
$users_caption = UOJLocale::get('users count'); $users_caption = UOJLocale::get('users count');
$header = <<<EOD $header = <<<EOD
<tr> <tr>
@ -65,22 +65,22 @@ EOD;
$from = "`groups` a left join groups_users b on a.id = b.group_id"; $from = "`groups` a left join groups_users b on a.id = b.group_id";
echoLongTable( echoLongTable(
array('a.id as group_id', 'a.title as title', 'a.is_hidden as is_hidden', 'count(b.username) as user_count'), 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', $from, $cond, 'group by a.id order by a.id asc',
$header, $header,
'echoGroup', 'echoGroup',
array('page_len' => 100, array('page_len' => 100,
'table_classes' => array('table', 'table-bordered', 'table-hover', 'table-striped'), 'table_classes' => array('table', 'table-bordered', 'table-hover', 'table-striped'),
'print_after_table' => function() { 'print_after_table' => function() {
global $myUser; global $myUser;
if (isSuperUser($myUser)) { if (isSuperUser($myUser)) {
global $new_group_form; global $new_group_form;
$new_group_form->printHTML(); $new_group_form->printHTML();
} }
}, },
'head_pagination' => true 'head_pagination' => true
) )
); );
?> ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -60,10 +60,10 @@
$styler->show_small_tip = false; $styler->show_small_tip = false;
} }
} }
?> ?>
<?php <?php
$REQUIRE_LIB['shjs'] = ""; $REQUIRE_LIB['shjs'] = "";
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('problems::hack').' #'.$hack['id']) ?> <?php echoUOJPageHeader(UOJLocale::get('problems::hack').' #'.$hack['id']) ?>
<?php echoHackListOnlyOne($hack, array(), $myUser) ?> <?php echoHackListOnlyOne($hack, array(), $myUser) ?>

View File

@ -48,7 +48,7 @@
$cond = '1'; $cond = '1';
} }
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('hacks')) ?> <?php echoUOJPageHeader(UOJLocale::get('hacks')) ?>
<div class="d-none d-sm-block"> <div class="d-none d-sm-block">
<?php if ($myUser != null): ?> <?php if ($myUser != null): ?>
@ -104,6 +104,6 @@
<div class="top-buffer-sm"></div> <div class="top-buffer-sm"></div>
</div> </div>
<?php <?php
echoHacksList($cond, 'order by id desc', array('judge_time_hidden' => ''), $myUser); echoHacksList($cond, 'order by id desc', array('judge_time_hidden' => ''), $myUser);
?> ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -1,7 +1,7 @@
<?php <?php
$blogs = DB::selectAll("select blogs.id, title, poster, post_time from important_blogs, blogs where is_hidden = 0 and important_blogs.blog_id = blogs.id order by level desc, important_blogs.blog_id desc limit 5"); $blogs = DB::selectAll("select blogs.id, title, poster, post_time from important_blogs, blogs where is_hidden = 0 and important_blogs.blog_id = blogs.id order by level desc, important_blogs.blog_id desc limit 5");
$countdowns = DB::selectAll("select * from countdowns order by endtime asc limit 5") $countdowns = DB::selectAll("select * from countdowns order by endtime asc limit 5")
?> ?>
<?php echoUOJPageHeader(UOJConfig::$data['profile']['oj-name-short']) ?> <?php echoUOJPageHeader(UOJConfig::$data['profile']['oj-name-short']) ?>
<div class="row"> <div class="row">
<div class="col-sm-12 col-md-9"> <div class="col-sm-12 col-md-9">
@ -19,11 +19,11 @@
<?php $now_cnt = 0; ?> <?php $now_cnt = 0; ?>
<?php foreach ($blogs as $blog): ?> <?php foreach ($blogs as $blog): ?>
<?php <?php
$now_cnt++; $now_cnt++;
$new_tag = ''; $new_tag = '';
if ((time() - strtotime($blog['post_time'])) / 3600 / 24 <= 7) { if ((time() - strtotime($blog['post_time'])) / 3600 / 24 <= 7) {
$new_tag = '<sup style="color:red">&nbsp;new</sup>'; $new_tag = '<sup style="color:red">&nbsp;new</sup>';
} }
?> ?>
<tr> <tr>
<td><a href="/blogs/<?= $blog['id'] ?>"><?= $blog['title'] ?></a><?= $new_tag ?></td> <td><a href="/blogs/<?= $blog['id'] ?>"><?= $blog['title'] ?></a><?= $new_tag ?></td>
@ -60,8 +60,8 @@
<?php foreach ($countdowns as $countdown): ?> <?php foreach ($countdowns as $countdown): ?>
<?php <?php
$enddate = strtotime($countdown['endtime']); $enddate = strtotime($countdown['endtime']);
$nowdate = time(); $nowdate = time();
$diff = floor(($enddate - $nowdate) / (24 * 60 * 60)); $diff = floor(($enddate - $nowdate) / (24 * 60 * 60));
?> ?>
<p class="card-text"> <p class="card-text">
<?php if ($diff > 0): ?> <?php if ($diff > 0): ?>

View File

@ -40,4 +40,4 @@
header("X-Sendfile: $file_name"); header("X-Sendfile: $file_name");
header("Content-type: $mimetype"); header("Content-type: $mimetype");
header("Content-Disposition: attachment; filename=$download_name"); header("Content-Disposition: attachment; filename=$download_name");
?> ?>

View File

@ -209,4 +209,4 @@
} }
echo json_encode($submission); echo json_encode($submission);
?> ?>

View File

@ -18,4 +18,4 @@
} }
die("ok"); die("ok");
?> ?>

View File

@ -49,10 +49,10 @@
unset($_SESSION['phrase']); unset($_SESSION['phrase']);
die(); die();
} }
?> ?>
<?php <?php
$REQUIRE_LIB['md5'] = ''; $REQUIRE_LIB['md5'] = '';
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('login')) ?> <?php echoUOJPageHeader(UOJLocale::get('login')) ?>
<h2 class="page-header"><?= UOJLocale::get('login') ?></h2> <h2 class="page-header"><?= UOJLocale::get('login') ?></h2>
<form id="form-login" class="form-horizontal" method="post"> <form id="form-login" class="form-horizontal" method="post">

View File

@ -1,7 +1,7 @@
<?php <?php
crsf_defend(); crsf_defend();
Auth::logout(); Auth::logout();
?> ?>
<script type="text/javascript"> <script type="text/javascript">
var prevUrl = document.referrer; var prevUrl = document.referrer;

View File

@ -214,11 +214,11 @@ EOD
$custom_test_form->submit_button_config['text'] = UOJLocale::get('problems::run'); $custom_test_form->submit_button_config['text'] = UOJLocale::get('problems::run');
$custom_test_form->runAtServer(); $custom_test_form->runAtServer();
} }
?> ?>
<?php <?php
$REQUIRE_LIB['mathjax'] = ''; $REQUIRE_LIB['mathjax'] = '';
$REQUIRE_LIB['shjs'] = ''; $REQUIRE_LIB['shjs'] = '';
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - ' . UOJLocale::get('problems::problem')) ?> <?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - ' . UOJLocale::get('problems::problem')) ?>
<?php <?php
$limit = getUOJConf("/var/uoj_data/{$problem['id']}/problem.conf"); $limit = getUOJConf("/var/uoj_data/{$problem['id']}/problem.conf");
@ -226,7 +226,7 @@ EOD
$memory_limit = $limit['memory_limit']; $memory_limit = $limit['memory_limit'];
$problem_uploader = $limit['poster'] ?: $problem['uploader']; $problem_uploader = $limit['poster'] ?: $problem['uploader'];
?> ?>
<div class="row d-flex justify-content-center"> <div class="row d-flex justify-content-center">
<span class="badge badge-secondary mr-1">时间限制:<?=$time_limit!=null?"$time_limit s":"N/A"?></span> <span class="badge badge-secondary mr-1">时间限制:<?=$time_limit!=null?"$time_limit s":"N/A"?></span>
<span class="badge badge-secondary mr-1">空间限制:<?=$memory_limit!=null?"$memory_limit MB":"N/A"?></span> <span class="badge badge-secondary mr-1">空间限制:<?=$memory_limit!=null?"$memory_limit MB":"N/A"?></span>

View File

@ -615,10 +615,10 @@ EOD
$rejudge_form->runAtServer(); $rejudge_form->runAtServer();
$rejudgege97_form->runAtServer(); $rejudgege97_form->runAtServer();
$info_form->runAtServer(); $info_form->runAtServer();
?> ?>
<?php <?php
$REQUIRE_LIB['dialog'] = ''; $REQUIRE_LIB['dialog'] = '';
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 数据 - 题目管理') ?> <?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 数据 - 题目管理') ?>
<h1 class="page-header" align="center">#<?=$problem['id']?> : <?=$problem['title']?> 管理</h1> <h1 class="page-header" align="center">#<?=$problem['id']?> : <?=$problem['title']?> 管理</h1>
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">

View File

@ -34,7 +34,7 @@
); );
$managers_form->runAtServer(); $managers_form->runAtServer();
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 管理者 - 题目管理') ?> <?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 管理者 - 题目管理') ?>
<h1 class="page-header" align="center">#<?=$problem['id']?> : <?=$problem['title']?> 管理</h1> <h1 class="page-header" align="center">#<?=$problem['id']?> : <?=$problem['title']?> 管理</h1>
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">
@ -53,13 +53,13 @@
</thead> </thead>
<tbody> <tbody>
<?php <?php
$row_id = 0; $row_id = 0;
$result = DB::query("select username from problems_permissions where problem_id = ${problem['id']}"); $result = DB::query("select username from problems_permissions where problem_id = ${problem['id']}");
while ($row = DB::fetch($result, MYSQLI_ASSOC)) { while ($row = DB::fetch($result, MYSQLI_ASSOC)) {
$row_id++; $row_id++;
echo '<tr>', '<td>', $row_id, '</td>', '<td>', getUserLink($row['username']), '</td>', '</tr>'; echo '<tr>', '<td>', $row_id, '</td>', '<td>', getUserLink($row['username']), '</td>', '</tr>';
} }
?> ?>
</tbody> </tbody>
</table> </table>
<p class="text-center">命令格式:命令一行一个,+mike表示把mike加入管理者-mike表示把mike从管理者中移除</p> <p class="text-center">命令格式:命令一行一个,+mike表示把mike加入管理者-mike表示把mike从管理者中移除</p>

View File

@ -143,7 +143,7 @@ EOD;
$div_classes = array('table-responsive'); $div_classes = array('table-responsive');
$table_classes = array('table', 'table-bordered', 'table-hover', 'table-striped'); $table_classes = array('table', 'table-bordered', 'table-hover', 'table-striped');
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('problems')) ?> <?php echoUOJPageHeader(UOJLocale::get('problems')) ?>
<div class="row"> <div class="row">
<div class="col-sm-4"> <div class="col-sm-4">
@ -177,7 +177,7 @@ $('#input-show_submit_mode').click(function() {
}); });
</script> </script>
<?php <?php
echo '<div class="', join($div_classes, ' '), '">'; echo '<div class="', join($div_classes, ' '), '">';
echo '<table class="', join($table_classes, ' '), '">'; echo '<table class="', join($table_classes, ' '), '">';
echo '<thead>'; echo '<thead>';
echo $header; echo $header;
@ -201,5 +201,5 @@ $('#input-show_submit_mode').click(function() {
} }
echo $pag->pagination(); echo $pag->pagination();
?> ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -53,7 +53,7 @@
}; };
$problem_editor->runAtServer(); $problem_editor->runAtServer();
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 编辑 - 题目管理') ?> <?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - 编辑 - 题目管理') ?>
<h1 class="page-header" align="center">#<?=$problem['id']?> : <?=$problem['title']?> 管理</h1> <h1 class="page-header" align="center">#<?=$problem['id']?> : <?=$problem['title']?> 管理</h1>
<ul class="nav nav-tabs" role="tablist"> <ul class="nav nav-tabs" role="tablist">

View File

@ -61,10 +61,10 @@
} }
$submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']) ? 'time' : 'tot_size'; $submissions_sort_by_choice = !isset($_COOKIE['submissions-sort-by-code-length']) ? 'time' : 'tot_size';
?> ?>
<?php <?php
$REQUIRE_LIB['morris'] = ""; $REQUIRE_LIB['morris'] = "";
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - ' . UOJLocale::get('problems::statistics')) ?> <?php echoUOJPageHeader(HTML::stripTags($problem['title']) . ' - ' . UOJLocale::get('problems::statistics')) ?>
<h1 class="page-header text-center"><?= $problem['title'] ?> <?= UOJLocale::get('problems::statistics') ?></h1> <h1 class="page-header text-center"><?= $problem['title'] ?> <?= UOJLocale::get('problems::statistics') ?></h1>

View File

@ -13,7 +13,7 @@
} else { } else {
become404Page(); become404Page();
} }
?> ?>
<?php echoUOJPageHeader($title) ?> <?php echoUOJPageHeader($title) ?>
<?php echoRanklist($config) ?> <?php echoRanklist($config) ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -59,11 +59,11 @@
} }
die(); die();
} }
?> ?>
<?php <?php
$REQUIRE_LIB['md5'] = ''; $REQUIRE_LIB['md5'] = '';
$REQUIRE_LIB['dialog'] = ''; $REQUIRE_LIB['dialog'] = '';
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('register')) ?> <?php echoUOJPageHeader(UOJLocale::get('register')) ?>
<h2 class="page-header"><?= UOJLocale::get('register') ?></h2> <h2 class="page-header"><?= UOJLocale::get('register') ?></h2>
<form id="form-register" class="form-horizontal"> <form id="form-register" class="form-horizontal">

View File

@ -29,11 +29,11 @@
if (isset($_POST['reset'])) { if (isset($_POST['reset'])) {
die(resetPassword()); die(resetPassword());
} }
?> ?>
<?php <?php
$REQUIRE_LIB['dialog'] = ''; $REQUIRE_LIB['dialog'] = '';
$REQUIRE_LIB['md5'] = ''; $REQUIRE_LIB['md5'] = '';
?> ?>
<?php echoUOJPageHeader('更改密码') ?> <?php echoUOJPageHeader('更改密码') ?>
<h2 class="page-header">更改密码</h2> <h2 class="page-header">更改密码</h2>
<form id="form-reset" class="form-horizontal"> <form id="form-reset" class="form-horizontal">

View File

@ -4,7 +4,7 @@
if (!Auth::check()) { if (!Auth::check()) {
become403Page(UOJLocale::get('need login')); become403Page(UOJLocale::get('need login'));
} }
?> ?>
<?php echoUOJPageHeader('关于我') ?> <?php echoUOJPageHeader('关于我') ?>
<?php if (UOJContext::user()['username'] != 'vfleaking'): ?> <?php if (UOJContext::user()['username'] != 'vfleaking'): ?>

View File

@ -31,7 +31,7 @@
requireLib('mathjax'); requireLib('mathjax');
requireLib('shjs'); requireLib('shjs');
?> ?>
<?php echoUOJPageHeader('日志') ?> <?php echoUOJPageHeader('日志') ?>
<div class="row"> <div class="row">

View File

@ -140,11 +140,11 @@
'tail' => 'order by id asc', 'tail' => 'order by id asc',
'page_len' => 20 'page_len' => 20
)); ));
?> ?>
<?php <?php
$REQUIRE_LIB['mathjax'] = ''; $REQUIRE_LIB['mathjax'] = '';
$REQUIRE_LIB['shjs'] = ''; $REQUIRE_LIB['shjs'] = '';
?> ?>
<?php echoUOJPageHeader(HTML::stripTags($blog['title']) . ' - 博客') ?> <?php echoUOJPageHeader(HTML::stripTags($blog['title']) . ' - 博客') ?>
<?php echoBlog($blog, array('show_title_only' => isset($_GET['page']) && $_GET['page'] != 1)) ?> <?php echoBlog($blog, array('show_title_only' => isset($_GET['page']) && $_GET['page'] != 1)) ?>
<h2>评论 <span class="glyphicon glyphicon-comment"></span></h2> <h2>评论 <span class="glyphicon glyphicon-comment"></span></h2>
@ -162,7 +162,7 @@
$replies[$idx]['poster_realname'] = queryUser($reply['poster'])['realname']; $replies[$idx]['poster_realname'] = queryUser($reply['poster'])['realname'];
} }
$replies_json = json_encode($replies); $replies_json = json_encode($replies);
?> ?>
<div id="comment-<?= $comment['id'] ?>" class="list-group-item"> <div id="comment-<?= $comment['id'] ?>" class="list-group-item">
<div class="media"> <div class="media">
<div class="media-left comtposterbox mr-3"> <div class="media-left comtposterbox mr-3">

View File

@ -22,7 +22,7 @@
$delete_form->succ_href = "/archive"; $delete_form->succ_href = "/archive";
$delete_form->runAtServer(); $delete_form->runAtServer();
?> ?>
<?php echoUOJPageHeader('删除博客 - ' . HTML::stripTags($blog['title'])) ?> <?php echoUOJPageHeader('删除博客 - ' . HTML::stripTags($blog['title'])) ?>
<h3>您真的要删除博客 <?= $blog['title'] ?> 吗?该操作不可逆!</h3> <h3>您真的要删除博客 <?= $blog['title'] ?> 吗?该操作不可逆!</h3>
<?php $delete_form->printHTML(); ?> <?php $delete_form->printHTML(); ?>

View File

@ -67,7 +67,7 @@
}; };
$blog_editor->runAtServer(); $blog_editor->runAtServer();
?> ?>
<?php echoUOJPageHeader('写博客') ?> <?php echoUOJPageHeader('写博客') ?>
<div class="text-right"> <div class="text-right">
<a href="http://uoj.ac/blog/7">这玩意儿怎么用?</a> <a href="http://uoj.ac/blog/7">这玩意儿怎么用?</a>

View File

@ -10,11 +10,11 @@
'tail' => 'order by post_time desc limit 5', 'tail' => 'order by post_time desc limit 5',
'echo_full' => true 'echo_full' => true
)); ));
?> ?>
<?php <?php
$REQUIRE_LIB['mathjax'] = ''; $REQUIRE_LIB['mathjax'] = '';
$REQUIRE_LIB['shjs'] = ''; $REQUIRE_LIB['shjs'] = '';
?> ?>
<?php echoUOJPageHeader(UOJContext::user()['username'] . '的博客') ?> <?php echoUOJPageHeader(UOJContext::user()['username'] . '的博客') ?>
<div class="row"> <div class="row">

View File

@ -1,7 +1,6 @@
<?php <?php
call_user_func(function() { // to prevent variable scope leak call_user_func(function() { // to prevent variable scope leak
Route::pattern('id', '[1-9][0-9]{0,9}'); Route::pattern('id', '[1-9][0-9]{0,9}');
Route::pattern('blog_username', '[a-zA-Z0-9_\-]{1,20}'); Route::pattern('blog_username', '[a-zA-Z0-9_\-]{1,20}');

View File

@ -16,4 +16,4 @@
$page_config['PageTitle'] = HTML::stripTags($blog['title']) . ' - 幻灯片'; $page_config['PageTitle'] = HTML::stripTags($blog['title']) . ' - 幻灯片';
$page_config['content'] = $blog['content']; $page_config['content'] = $blog['content'];
uojIncludeView('slide', $page_config); uojIncludeView('slide', $page_config);
?> ?>

View File

@ -66,7 +66,7 @@
}; };
$blog_editor->runAtServer(); $blog_editor->runAtServer();
?> ?>
<?php echoUOJPageHeader('写幻灯片') ?> <?php echoUOJPageHeader('写幻灯片') ?>
<div class="text-right"> <div class="text-right">
<a href="http://uoj.ac/blog/75">这玩意儿怎么用?</a> <a href="http://uoj.ac/blog/75">这玩意儿怎么用?</a>

View File

@ -132,10 +132,10 @@
} }
} }
} }
?> ?>
<?php <?php
$REQUIRE_LIB['shjs'] = ""; $REQUIRE_LIB['shjs'] = "";
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('problems::submission').' #'.$submission['id']) ?> <?php echoUOJPageHeader(UOJLocale::get('problems::submission').' #'.$submission['id']) ?>
<?php echoSubmissionsListOnlyOne($submission, array(), $myUser) ?> <?php echoSubmissionsListOnlyOne($submission, array(), $myUser) ?>

View File

@ -37,7 +37,7 @@
} else { } else {
$cond = '1'; $cond = '1';
} }
?> ?>
<?php echoUOJPageHeader(UOJLocale::get('submissions')) ?> <?php echoUOJPageHeader(UOJLocale::get('submissions')) ?>
<div class="d-none d-sm-block"> <div class="d-none d-sm-block">
<?php if ($myUser != null): ?> <?php if ($myUser != null): ?>
@ -86,6 +86,6 @@
<div class="top-buffer-sm"></div> <div class="top-buffer-sm"></div>
</div> </div>
<?php <?php
echoSubmissionsList($cond, 'order by id desc', array('judge_time_hidden' => ''), $myUser); echoSubmissionsList($cond, 'order by id desc', array('judge_time_hidden' => ''), $myUser);
?> ?>
<?php echoUOJPageFooter() ?> <?php echoUOJPageFooter() ?>

View File

@ -307,14 +307,14 @@
null null
); );
$countdown_adder->addInput('new_countdown_endtime', 'text', '截止日期', date("Y-m-d H:i:s"), $countdown_adder->addInput('new_countdown_endtime', 'text', '截止日期', date("Y-m-d H:i:s"),
function($str, &$vdata) { function($str, &$vdata) {
try { try {
$vdata['new_countdown_endtime'] = new DateTime($str); $vdata['new_countdown_endtime'] = new DateTime($str);
} catch (Exception $e) { } catch (Exception $e) {
return '无效时间格式'; return '无效时间格式';
} }
return ''; return '';
}, },
null null
); );
$countdown_adder->handle = function() { $countdown_adder->handle = function() {
@ -326,21 +326,21 @@
}; };
$countdown_adder->runAtServer(); $countdown_adder->runAtServer();
$countdown_deleter = new UOJForm('delete_countdown'); $countdown_deleter = new UOJForm('delete_countdown');
$countdown_deleter->submit_button_config['align'] = 'compressed'; $countdown_deleter->submit_button_config['align'] = 'compressed';
$countdown_deleter->addInput('delete_countdown_id', 'text', 'ID', '', $countdown_deleter->addInput('delete_countdown_id', 'text', 'ID', '',
function ($delete_countdown_id) { function ($delete_countdown_id) {
return ''; return '';
}, },
null null
); );
$countdown_deleter->handle = function() { $countdown_deleter->handle = function() {
$delete_countdown_id = $_POST['delete_countdown_id']; $delete_countdown_id = $_POST['delete_countdown_id'];
$delete_countdown_id = DB::escape($delete_countdown_id); $delete_countdown_id = DB::escape($delete_countdown_id);
DB::query("delete from countdowns where id = '$delete_countdown_id'"); DB::query("delete from countdowns where id = '$delete_countdown_id'");
}; };
$countdown_deleter->runAtServer(); $countdown_deleter->runAtServer();
$countdowns_header_row = <<<EOD $countdowns_header_row = <<<EOD
<tr> <tr>
@ -349,15 +349,15 @@
<th>时间</th> <th>时间</th>
</tr> </tr>
EOD; EOD;
$countdowns_print_row = function($row) { $countdowns_print_row = function($row) {
echo <<<EOD echo <<<EOD
<tr> <tr>
<td>{$row['id']}</td> <td>{$row['id']}</td>
<td>{$row['title']}</td> <td>{$row['title']}</td>
<td>{$row['endtime']}</td> <td>{$row['endtime']}</td>
</tr> </tr>
EOD; EOD;
}; };
$contest_submissions_deleter = new UOJForm('contest_submissions'); $contest_submissions_deleter = new UOJForm('contest_submissions');
$contest_submissions_deleter->addInput('contest_id', 'text', '比赛ID', '', $contest_submissions_deleter->addInput('contest_id', 'text', '比赛ID', '',
@ -535,11 +535,11 @@ EOD;
if (!isset($tabs_info[$cur_tab])) { if (!isset($tabs_info[$cur_tab])) {
become404Page(); become404Page();
} }
?> ?>
<?php <?php
requireLib('shjs'); requireLib('shjs');
requireLib('morris'); requireLib('morris');
?> ?>
<?php echoUOJPageHeader('系统管理') ?> <?php echoUOJPageHeader('系统管理') ?>
<div class="row"> <div class="row">
<div class="col-sm-3"> <div class="col-sm-3">
@ -615,13 +615,13 @@ EOD;
<?php elseif ($cur_tab === 'custom-test'): ?> <?php elseif ($cur_tab === 'custom-test'): ?>
<?php $custom_test_deleter->printHTML() ?> <?php $custom_test_deleter->printHTML() ?>
<?php <?php
$submissions_pag = new Paginator(array( $submissions_pag = new Paginator(array(
'col_names' => array('*'), 'col_names' => array('*'),
'table_name' => 'custom_test_submissions', 'table_name' => 'custom_test_submissions',
'cond' => '1', 'cond' => '1',
'tail' => 'order by id asc', 'tail' => 'order by id asc',
'page_len' => 5 'page_len' => 5
)); ));
foreach ($submissions_pag->get() as $submission) { foreach ($submissions_pag->get() as $submission) {
$problem = queryProblemBrief($submission['problem_id']); $problem = queryProblemBrief($submission['problem_id']);
$submission_result = json_decode($submission['result'], true); $submission_result = json_decode($submission['result'], true);
@ -640,7 +640,7 @@ EOD;
echoSubmissionContent($submission, getProblemCustomTestRequirement($problem)); echoSubmissionContent($submission, getProblemCustomTestRequirement($problem));
echoCustomTestSubmissionDetails($submission_result['details'], "submission-{$submission['id']}-details"); echoCustomTestSubmissionDetails($submission_result['details'], "submission-{$submission['id']}-details");
} }
?> ?>
<?= $submissions_pag->pagination() ?> <?= $submissions_pag->pagination() ?>
<?php elseif ($cur_tab === 'judger'): ?> <?php elseif ($cur_tab === 'judger'): ?>
<div> <div>

View File

@ -10,11 +10,11 @@
$username = $_GET['username']; $username = $_GET['username'];
$REQUIRE_LIB['github_contribution_graph'] = ''; $REQUIRE_LIB['github_contribution_graph'] = '';
?> ?>
<?php if (validateUsername($username) && ($user = queryUser($username))): ?> <?php if (validateUsername($username) && ($user = queryUser($username))): ?>
<?php echoUOJPageHeader($user['username'] . ' - ' . UOJLocale::get('user profile')) ?> <?php echoUOJPageHeader($user['username'] . ' - ' . UOJLocale::get('user profile')) ?>
<?php <?php
$esc_email = HTML::escape($user['email']); $esc_email = HTML::escape($user['email']);
$esc_qq = HTML::escape($user['qq'] != 0 ? $user['qq'] : 'Unfilled'); $esc_qq = HTML::escape($user['qq'] != 0 ? $user['qq'] : 'Unfilled');
$esc_sex = HTML::escape($user['sex']); $esc_sex = HTML::escape($user['sex']);
$col_sex="color:blue"; $col_sex="color:blue";
@ -28,7 +28,7 @@
$esc_sex=""; $esc_sex="";
$col_sex="color:black"; $col_sex="color:black";
} }
$esc_motto = HTML::escape($user['motto']); $esc_motto = HTML::escape($user['motto']);
?> ?>
<div class="card border-info"> <div class="card border-info">
<h5 class="card-header bg-info"><?= UOJLocale::get('user profile') ?></h5> <h5 class="card-header bg-info"><?= UOJLocale::get('user profile') ?></h5>
@ -84,25 +84,25 @@
<div class="list-group-item"> <div class="list-group-item">
<?php <?php
$_result = DB::query("select date(submit_time), problem_id from submissions where submitter = '{$username}' and score = 100 and date(submit_time) between date_sub(curdate(), interval 1 year) and curdate()"); $_result = DB::query("select date(submit_time), problem_id from submissions where submitter = '{$username}' and score = 100 and date(submit_time) between date_sub(curdate(), interval 1 year) and curdate()");
$result = []; $result = [];
$vis = []; $vis = [];
while ($row = DB::fetch($_result)) { while ($row = DB::fetch($_result)) {
$id = $row['date(submit_time)'] . ':' . $row['problem_id']; $id = $row['date(submit_time)'] . ':' . $row['problem_id'];
if (!$vis[$id]) { if (!$vis[$id]) {
$vis[$id] = 1; $vis[$id] = 1;
$result[strtotime($row['date(submit_time)']) * 1000]++; $result[strtotime($row['date(submit_time)']) * 1000]++;
} }
} }
?> ?>
<h4 class="list-group-item-heading"><?= UOJLocale::get('n accepted in last year', count($result)) ?></h4> <h4 class="list-group-item-heading"><?= UOJLocale::get('n accepted in last year', count($result)) ?></h4>
<div id="accepted-graph"></div> <div id="accepted-graph"></div>
<script> <script>
var accepted_graph_data = [ var accepted_graph_data = [
<?php <?php
foreach ($result as $key => $val) { foreach ($result as $key => $val) {
echo "{ timestamp: {$key}, count: {$val} }, "; echo "{ timestamp: {$key}, count: {$val} }, ";
} }
?> ?>
]; ];
$(document).ready(function () { $(document).ready(function () {
@ -117,17 +117,17 @@
<div class="list-group-item"> <div class="list-group-item">
<?php <?php
$ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';"); $ac_problems = DB::selectAll("select a.problem_id as problem_id, b.title as title from best_ac_submissions a inner join problems b on a.problem_id = b.id where submitter = '{$user['username']}';");
?> ?>
<h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4> <h4 class="list-group-item-heading"><?= UOJLocale::get('accepted problems').''.UOJLocale::get('n problems in total', count($ac_problems))?> </h4>
<p class="list-group-item-text"> <p class="list-group-item-text">
<?php <?php
foreach ($ac_problems as $problem) { foreach ($ac_problems as $problem) {
echo '<a href="/problem/', $problem['problem_id'], '" style="display:inline-block; margin-right:0.25em;">#', $problem['problem_id'], '. ', $problem['title'], '</a>'; echo '<a href="/problem/', $problem['problem_id'], '" style="display:inline-block; margin-right:0.25em;">#', $problem['problem_id'], '. ', $problem['title'], '</a>';
} }
if (empty($ac_problems)) { if (empty($ac_problems)) {
echo UOJLocale::get('none'); echo UOJLocale::get('none');
} }
?> ?>
</p> </p>
</div> </div>
</div> </div>

View File

@ -81,26 +81,26 @@
return json_encode($ret); return json_encode($ret);
} }
/* /*
function deleteMsg($msgId) { function deleteMsg($msgId) {
return 1; return 1;
$str = <<<EOD $str = <<<EOD
select * from user_msg select * from user_msg
where id = $msgId where id = $msgId
and read_time is null and read_time is null
EOD; EOD;
$result = DB::query($str); $result = DB::query($str);
if (DB::fetch($result)) { if (DB::fetch($result)) {
$str = <<<EOD $str = <<<EOD
delete from user_msg delete from user_msg
where id = $msgId where id = $msgId
EOD; EOD;
DB::query($str); DB::query($str);
return 1; return 1;
} }
return 0; return 0;
} }
*/ */
if (isset($_POST['user_msg'])) { if (isset($_POST['user_msg'])) {
die(handleMsgPost()); die(handleMsgPost());
@ -109,7 +109,7 @@ EOD;
} elseif (isset($_GET['getHistory'])) { } elseif (isset($_GET['getHistory'])) {
die(getHistory()); die(getHistory());
} }
?> ?>
<?php echoUOJPageHeader('私信') ?> <?php echoUOJPageHeader('私信') ?>

View File

@ -22,7 +22,7 @@ EOD;
echo '<td>'.$msg['send_time'].'</td>'; echo '<td>'.$msg['send_time'].'</td>';
echo '</tr>'; echo '</tr>';
} }
?> ?>
<?php echoUOJPageHeader('系统消息') ?> <?php echoUOJPageHeader('系统消息') ?>
<h2>系统消息</h2> <h2>系统消息</h2>
<?php echoLongTable(array('*'), 'user_system_msg', "receiver='" . Auth::id() . "'", 'order by id desc', $header_row, 'echoSysMsg', array('table_classes' => array('table'))) ?> <?php echoLongTable(array('*'), 'user_system_msg', "receiver='" . Auth::id() . "'", 'order by id desc', $header_row, 'echoSysMsg', array('table_classes' => array('table'))) ?>

View File

@ -356,4 +356,4 @@
error_log('hack successfully but sync failed.'); error_log('hack successfully but sync failed.');
} }
} }
?> ?>

View File

@ -384,7 +384,7 @@ EOD
$('#form-group-$name').text_file_form_group('$name', '$text'); $('#form-group-$name').text_file_form_group('$name', '$text');
</script> </script>
EOD EOD
); );
$this->is_big = true; $this->is_big = true;
$this->has_file = true; $this->has_file = true;
@ -818,4 +818,4 @@ EOD;
}; };
return $form; return $form;
} }
?> ?>

View File

@ -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"); 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");
} }
?> ?>

View File

@ -33,4 +33,4 @@
UOJLocale::setLocale($_GET['locale']); UOJLocale::setLocale($_GET['locale']);
} }
UOJLocale::requireModule('basic'); UOJLocale::requireModule('basic');
?> ?>

View File

@ -156,7 +156,7 @@ marked.setOptions({
} }
}) })
EOD EOD
); );
} catch (V8JsException $e) { } catch (V8JsException $e) {
die(json_encode(array('content_md' => '未知错误'))); die(json_encode(array('content_md' => '未知错误')));
} }

View File

@ -13,7 +13,7 @@
$extra_text = $blog['is_hidden'] ? '<span class="text-muted">[已隐藏]</span> ' : ''; $extra_text = $blog['is_hidden'] ? '<span class="text-muted">[已隐藏]</span> ' : '';
$blog_type = $blog['type'] == 'B' ? 'post' : 'slide'; $blog_type = $blog['type'] == 'B' ? 'post' : 'slide';
?> ?>
<h2><?= $extra_text ?><a class="header-a" href="<?= HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']) ?>"><?= $blog['title'] ?></a></h2> <h2><?= $extra_text ?><a class="header-a" href="<?= HTML::blog_url(UOJContext::userid(), '/post/'.$blog['id']) ?>"><?= $blog['title'] ?></a></h2>
<div><?= $blog['post_time'] ?> <strong>By</strong> <?= getUserLink($blog['poster']) ?></div> <div><?= $blog['post_time'] ?> <strong>By</strong> <?= getUserLink($blog['poster']) ?></div>
<?php if (!$show_title_only): ?> <?php if (!$show_title_only): ?>

View File

@ -11,9 +11,9 @@
<tr> <tr>
<?php <?php
echo $contest_problems[$i]['submission_id'] ? '<td class="success">' : '<td>'; echo $contest_problems[$i]['submission_id'] ? '<td class="success">' : '<td>';
echo chr(ord('A') + $i); echo chr(ord('A') + $i);
echo '</td>'; echo '</td>';
?> ?>
<td><?= getContestProblemLink($contest_problems[$i]['problem'], $contest['id']) ?></td> <td><?= getContestProblemLink($contest_problems[$i]['problem'], $contest['id']) ?></td>
</tr> </tr>
<?php endfor ?> <?php endfor ?>

View File

@ -2,7 +2,7 @@
if (!isset($ShowPageFooter)) { if (!isset($ShowPageFooter)) {
$ShowPageFooter = true; $ShowPageFooter = true;
} }
?> ?>
</div> </div>
<?php if ($ShowPageFooter): ?> <?php if ($ShowPageFooter): ?>
<div class="uoj-footer"> <div class="uoj-footer">

View File

@ -28,7 +28,7 @@
if (!isset($ShowPageHeader)) { if (!isset($ShowPageHeader)) {
$ShowPageHeader = true; $ShowPageHeader = true;
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="<?= UOJLocale::locale() ?>"> <html lang="<?= UOJLocale::locale() ?>">
<head> <head>

View File

@ -11,7 +11,7 @@
if (!isset($slide_config['theme'])) { if (!isset($slide_config['theme'])) {
$slide_config['theme'] = 'moon'; $slide_config['theme'] = 'moon';
} }
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="zh-cn"> <html lang="zh-cn">
<head> <head>