diff options
| author | cassiopc <cassiopc@gmail.com> | 2012-11-02 17:45:39 +0000 |
|---|---|---|
| committer | cassiopc <cassiopc@gmail.com> | 2012-11-02 17:45:39 +0000 |
| commit | 0843815a126c9f0282113592e54b17e5823624d2 (patch) | |
| tree | d346f0f3a5e291ff7170f5261c07affb29e1f2e3 /boca-1.5.2/src/scoretable.php | |
| parent | f332739571d7929d97b0e503b1160d61d557fcfc (diff) | |
| download | boca-0843815a126c9f0282113592e54b17e5823624d2.tar.gz boca-0843815a126c9f0282113592e54b17e5823624d2.zip | |
small score visualization bug fix; sort of score files to produce the most recent score bug fix
Diffstat (limited to 'boca-1.5.2/src/scoretable.php')
| -rw-r--r-- | boca-1.5.2/src/scoretable.php | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/boca-1.5.2/src/scoretable.php b/boca-1.5.2/src/scoretable.php index dcfc7a6..383705d 100644 --- a/boca-1.5.2/src/scoretable.php +++ b/boca-1.5.2/src/scoretable.php @@ -96,6 +96,7 @@ if(file_exists($scoretmp)) { } if($_SESSION["usertable"]["usertype"]=='score' || $_SESSION["usertable"]["usertype"]=='admin' || (isset($_GET["remote"]) && is_numeric($_GET["remote"]))) { + $privatedir = $_SESSION['locr'] . $ds . "private"; $remotedir = $_SESSION['locr'] . $ds . "private" . $ds . "remotescores"; $destination = $remotedir . $ds ."scores.zip"; if(is_writable($remotedir)) { @@ -107,11 +108,22 @@ if($_SESSION["usertable"]["usertype"]=='score' || $_SESSION["usertable"]["userty $data0 = array(); if($level>0) { list($score,$data0) = DBScoreSite($_SESSION["usertable"]["contestnumber"], + $_SESSION["usertable"]["usersitenumber"], 0, -1); + } + $ct=DBGetActiveContest(); + $localsite=$ct['contestlocalsite']; + $fname = $privatedir . $ds . "score_localsite_" . $localsite . "_" . md5($_SERVER['HTTP_HOST']); + @file_put_contents($fname . ".tmp",base64_encode(serialize($data0))); + @rename($fname . ".tmp",$fname . ".dat"); + + $data0 = array(); + if($level>0) { + list($score,$data0) = DBScoreSite($_SESSION["usertable"]["contestnumber"], $_SESSION["usertable"]["usersitenumber"], 1, -1); } $ct=DBGetActiveContest(); $localsite=$ct['contestlocalsite']; - $fname = $remotedir . $ds . "score_site" . $localsite . "_" . md5($_SERVER['HTTP_HOST']); + $fname = $remotedir . $ds . "score_site" . $localsite . "_" . $localsite . "_" . md5($_SERVER['HTTP_HOST']); @file_put_contents($fname . ".tmp",base64_encode(serialize($data0))); @rename($fname . ".tmp",$fname . ".dat"); |