From a844dc7d621fc03d5846bd523d8b8899ecdba610 Mon Sep 17 00:00:00 2001 From: Cassio de Campos Date: Mon, 31 Jul 2017 18:16:01 +0100 Subject: bf --- src/admin/contest.php | 4 ---- src/fextdata.php | 8 +++++--- 2 files changed, 5 insertions(+), 7 deletions(-) (limited to 'src') 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; 1) echo "<= has been set"; ?> - Keys (only use it within a secure network): @@ -231,8 +229,6 @@ echo $contest; 32) echo "<= has been set"; ?> - Contest main site number: 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)) != "") { 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"); -- cgit v1.2.3