diff options
| -rw-r--r-- | src/admin/contest.php | 4 | ||||
| -rw-r--r-- | src/fextdata.php | 8 |
2 files changed, 5 insertions, 7 deletions
diff --git a/src/admin/contest.php b/src/admin/contest.php index f238212..d55361e 100644 --- a/src/admin/contest.php +++ b/src/admin/contest.php @@ -222,8 +222,6 @@ echo $contest; <?php if(strlen($ct["contestunlockkey"]) > 1) echo "<b><= has been set</b>"; ?> </td> </tr> - <?php if($main) { - ?> <tr> <td width="35%" align=right>Keys (only use it within a <b>secure network</b>):</td> <td width="65%"> @@ -231,8 +229,6 @@ echo $contest; <?php if(strlen($ct["contestkeys"]) > 32) echo "<b><= has been set</b>"; ?> </td> </tr> - <?php } - ?> <tr> <td width="35%" align=right>Contest main site number:</td> <td width="65%"> diff --git a/src/fextdata.php b/src/fextdata.php index 200d11f..cae9f63 100644 --- a/src/fextdata.php +++ b/src/fextdata.php @@ -278,9 +278,10 @@ function getMainXML() { if(strtoupper(substr($s,0,5)) != "<XML>") { return false; } - if(importFromXML($s, $contest, $localsite)) { + if(importFromXML($s, $contest, $localsite, 1+$ct['updatetime'])) { $str = $sitedata[0] . ' ' . $sitedata[1] . ' ' . $sitedata[2] . ' ' . $ti; - $param = array('contestnumber' => $contest, 'mainsiteurl' => $str); + $ti = 2+$ct['updatetime']; + $param = array('contestnumber' => $contest, 'mainsiteurl' => $str, 'updatetime' => $ti); DBUpdateContest ($param, null); return true; } else { @@ -292,7 +293,7 @@ function getMainXML() { return false; } -function importFromXML($ar,$contest,$site,$tomain=false) { +function importFromXML($ar,$contest,$site,$tomain=false,$uptime=0) { LOGInfo("importFromXML: contest $contest site $site tomain $tomain"); $data = implode("",explode("\n",$ar)); $parser = xml_parser_create(''); @@ -343,6 +344,7 @@ function importFromXML($ar,$contest,$site,$tomain=false) { unset($param['number']); if(!$tomain && $table == "contesttable") { + if($uptime > 0) $param['updatetime']=$uptime; if(($ret=DBUpdateContest ($param, $conn))) { if($ret==2) { LOGInfo("importFromXML: Contest " . $param["contestnumber"] . " updated"); |