diff --git a/web/app/controllers/index.php b/web/app/controllers/index.php
index 516dbe4..cee4de5 100644
--- a/web/app/controllers/index.php
+++ b/web/app/controllers/index.php
@@ -90,15 +90,17 @@ $friend_links = DB::selectAll([
getTimestamp();
+ $now_time = UOJTime::$time_now->getTimestamp();
+ $diff = floor(($end_time - $now_time) / (24 * 60 * 60));
?>
-
0) : ?>
- = UOJLocale::get('x days until countdown title', $countdown['title'], $diff) ?>
+ = UOJLocale::get('x days before countdown {title}', $countdown['title'], $diff) ?>
+
+ = UOJLocale::get('{rest} before countdown {title}', $countdown['title'], $end_time - $now_time) ?>
- = UOJLocale::get("countdown title has begun", $countdown['title']) ?>
+ = UOJLocale::get("countdown {title} has begun", $countdown['title']) ?>
diff --git a/web/app/controllers/super_manage.php b/web/app/controllers/super_manage.php
index 8982783..c576e83 100644
--- a/web/app/controllers/super_manage.php
+++ b/web/app/controllers/super_manage.php
@@ -190,7 +190,7 @@ if ($cur_tab == 'index') {
return '标题不能为空';
}
- $vdata['title'] = $title;
+ $vdata['title'] = HTML::escape($title);
return '';
},
diff --git a/web/app/locale/basic/en.php b/web/app/locale/basic/en.php
index 258ff0b..34820da 100644
--- a/web/app/locale/basic/en.php
+++ b/web/app/locale/basic/en.php
@@ -25,7 +25,7 @@ return [
'all the announcements' => 'All the Announcements……',
'solved' => 'Solved',
'top solver' => 'Top solver',
- 'n accepted in last year' => function($n) {
+ 'n accepted in last year' => function ($n) {
return "Submitted $n AC code" . ($n > 1 ? "s" : "") . " in last year";
},
'help' => 'Help',
@@ -53,8 +53,8 @@ return [
'browse' => 'Browse',
'score range' => 'Score range',
'details' => 'Details',
- 'hours' => function($h) {
- return "$h ".($h <= 1 ? 'hour' : 'hours');
+ 'hours' => function ($h) {
+ return "$h " . ($h <= 1 ? 'hour' : 'hours');
},
'title' => 'Title',
'content' => 'Content',
@@ -64,15 +64,15 @@ return [
'user profile' => 'User profile',
'send private message' => 'Send private message',
'modify my profile' => 'Modify my profile',
- 'modify his profile' => function($name) {
+ 'modify his profile' => function ($name) {
return "Modify $name's profile";
},
- 'visit his blog' => function($name) {
+ 'visit his blog' => function ($name) {
return "Visit $name's blog";
},
'accepted problems' => 'Accepted problems',
- 'n problems in total' => function($n) {
- return "$n ".($n <= 1 ? 'problem' : 'problems');
+ 'n problems in total' => function ($n) {
+ return "$n " . ($n <= 1 ? 'problem' : 'problems');
},
'please enter your password for authorization' => 'Please enter your password for authorization',
'please enter your new profile' => 'Please enter your new profile',
@@ -90,11 +90,14 @@ return [
'male' => 'Male',
'female' => 'Female',
'countdowns' => 'Countdowns',
- 'countdown title has begun' => function($title) {
+ 'countdown {title} has begun' => function ($title) {
return "$title has begun.";
},
- 'x days until countdown title' => function($title, $days) {
- return "$days ".($days <= 1 ? 'day' : 'days')." until $title.";
+ '{rest} before countdown {title}' => function ($title, $rest_seconds) {
+ return 'less than a day' . " before $title.";
+ },
+ 'x days before countdown {title}' => function ($title, $days) {
+ return "$days " . ($days <= 1 ? 'day' : 'days') . " before $title.";
},
'friend links' => 'Frequently Used Links',
'server time' => 'Server Time',
diff --git a/web/app/locale/basic/zh-cn.php b/web/app/locale/basic/zh-cn.php
index 185da5d..d2d44da 100644
--- a/web/app/locale/basic/zh-cn.php
+++ b/web/app/locale/basic/zh-cn.php
@@ -90,10 +90,13 @@ return [
'male' => '男',
'female' => '女',
'countdowns' => '倒计时',
- 'countdown title has begun' => function($title) {
+ 'countdown {title} has begun' => function($title) {
return "$title 已开始。";
},
- 'x days until countdown title' => function($title, $days) {
+ '{rest} before countdown {title}' => function ($title, $rest_seconds) {
+ return "距离 $title 还有 " . '不足 1 天。';
+ },
+ 'x days before countdown {title}' => function($title, $days) {
return "距离 $title 还有 $days 天。";
},
'friend links' => '常用链接',