aboutsummaryrefslogtreecommitdiff
path: root/src/fextdata.php
diff options
context:
space:
mode:
authorCassio de Campos <cassiopc@gmail.com>2017-07-31 17:16:01 +0000
committerCassio de Campos <cassiopc@gmail.com>2017-07-31 17:16:01 +0000
commita844dc7d621fc03d5846bd523d8b8899ecdba610 (patch)
tree15b6171d2e55fb7f82a02697b14c9c337d561db8 /src/fextdata.php
parent7558408460caded014e6dc685f9fdd0877a6c11b (diff)
downloadboca-a844dc7d621fc03d5846bd523d8b8899ecdba610.tar.gz
boca-a844dc7d621fc03d5846bd523d8b8899ecdba610.zip
bf
Diffstat (limited to 'src/fextdata.php')
-rw-r--r--src/fextdata.php8
1 files changed, 5 insertions, 3 deletions
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");