aboutsummaryrefslogtreecommitdiff
path: root/src/fcontest.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/fcontest.php')
-rw-r--r--src/fcontest.php10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/fcontest.php b/src/fcontest.php
index e61631b..ccd3e11 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -125,7 +125,7 @@ CREATE TABLE \"sitetimetable\" (
$r = DBexec($c, "CREATE INDEX \"sitetimesite_index\" ON \"sitetimetable\" USING btree ".
"(\"contestnumber\" int4_ops, \"sitenumber\" int4_ops)", "DBCreateSiteTimeTable(create site_index)");
}
-// begin; update answertable set updatetime=EXTRACT(EPOCH FROM now());
+// begin; update answertable set updatetime=EXTRACT(EPOCH FROM now()); select * from answertable;
// begin; update langtable set updatetime=EXTRACT(EPOCH FROM now()); select * from langtable;
// begin; update problemtable set updatetime=EXTRACT(EPOCH FROM now()); select * from problemtable;
@@ -1387,6 +1387,10 @@ function siteclock() {
return array("contest not running",-1000000000);
if ($s["currenttime"]<0) {
$t = - $s["currenttime"];
+ if($t>3600*24) {
+ $t = ((int) ($t/(360*24)))/10;
+ return array("&gt; ". $t . " day(s) to start",$s["currenttime"]);
+ }
if($t>3600) {
$t = ((int) ($t/360))/10;
return array("&gt; ". $t . " hour(s) to start",$s["currenttime"]);
@@ -1401,6 +1405,10 @@ function siteclock() {
if ($s["currenttime"]>=0) {
$t = $s["siteduration"] - $s["currenttime"];
$str = '';
+ if($t >= 3600*24) {
+ $str .= ((int)($t/(3600*24))) . 'd ';
+ $t = $t % (3600*24);
+ }
if($t >= 3600) {
$str .= ((int)($t/3600)) . 'h ';
$t = $t % 3600;