} } else { // So now we sort each team into order sortrank($hplayer, $pars->Rankfuzz); sortrank($aplayer, $pars->Rankfuzz); // Now assign colours either WBW or BWB $cols[0] = rand(1, 2); $cols[1] = 3 - $cols[0]; $cols[2] = $cols[0]; } // If matchdate has changed, fix it $newdate = new Matchdate(); $newdate->frompost(); $newslack = $_POST["slackd"]; // Fix changed date if ($newdate->unequal($mtch->Date) || $newslack != $mtch->Slackdays) { $mtch->Date = $newdate; $mtch->Slackdays = $newslack; $mtch->dateupdate(); } // Set up game details according to who is white/black // col=1 means "home" player is white otherwise black function setgteams($g, $col, $hteam, $ateam, $hplay, $aplay) { global $hcapable, $hred; // Force colour to white for stronger player if handicaps apply and rank // difference is greater than handicap reduction if ($hcapable) { if ($hplay->Rank->Rankvalue - $aplay->Rank->Rankvalue > $hred) { $col = 1; } elseif ($aplay->Rank->Rankvalue - $hplay->Rank->Rankvalue > $hred) {
try { $g->frompost(); $g->fetchdets(); } catch (GameException $e) { $mess = $e->getMessage(); include 'php/wrongentry.php'; exit(0); } $date_played = new Matchdate(); $date_played->frompost(); $sgfdata = ""; $fn = $_FILES["sgffile"]; if ($fn['error'] == UPLOAD_ERR_OK && preg_match('/.*\\.sgf$/i', $fn['name']) && $fn['size'] > 0) { $sgfdata = file_get_contents($fn['tmp_name']); } if ($date_played->unequal($g->Date)) { $g->reset_date($date_played); } $mtch = $g->set_result($_POST["result"], $_POST["resulttype"]); if (strlen($sgfdata) != 0) { $g->set_sgf($sgfdata); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <?php $Title = "Game Result Amended"; include 'php/head.php'; ?> <body> <script language="javascript" src="webfn.js"></script>