aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/fcontest.php7
-rw-r--r--src/fscore.php4
-rw-r--r--src/scoretable.php5
3 files changed, 13 insertions, 3 deletions
diff --git a/src/fcontest.php b/src/fcontest.php
index fa68b72..8f636f7 100644
--- a/src/fcontest.php
+++ b/src/fcontest.php
@@ -268,6 +268,9 @@ function DBUserInfo($contest, $site, $user, $c=null,$hashpass=true) {
}
function cleanuserdesc($a) {
$inst = explode(']',$a['userdesc']);
+ $a['userflag']='';
+ $a['usershortinstitution']='';
+ $a['usersitename']='';
if(isset($inst[1])) {
$inst2 = explode('[',$inst[0]);
if(isset($inst2[1]))
@@ -276,7 +279,9 @@ function cleanuserdesc($a) {
$a['userdesc']=trim($inst[2]);
$inst = explode('[',$inst[1]);
if(isset($inst[1])) {
- $a['userflag'] = trim($inst[1]);
+ $inst2 = explode(',',trim($inst[1]));
+ $a['userflag'] = $inst2[0];
+ if(isset($inst2[1])) $a['usersitename']=trim($inst2[1]);
}
} else {
$a['userdesc']=trim($inst[1]);
diff --git a/src/fscore.php b/src/fscore.php
index 4cadd7d..9687058 100644
--- a/src/fscore.php
+++ b/src/fscore.php
@@ -266,6 +266,10 @@ function DBScoreSite($contest, $site, $verifylastmile, $hor=-1, $data=null) {
$resp[$a["usernumber"]]["userfullname"]=$a["userfullname"];
$resp[$a["usernumber"]]["usershortinstitution"]=$a["usershortinstitution"];
$resp[$a["usernumber"]]["userflag"]=$a["userflag"];
+ if($a["usersitename"] == '')
+ $resp[$a["usernumber"]]["usersitename"]=$a["usersitenumber"];
+ else
+ $resp[$a["usernumber"]]["usersitename"]=$a["usersitename"];
$resp[$a["usernumber"]]["totaltime"]=0;
$resp[$a["usernumber"]]["totalcount"]=0;
$resp[$a["usernumber"]]["problem"]=array();
diff --git a/src/scoretable.php b/src/scoretable.php
index 690d5c1..8491611 100644
--- a/src/scoretable.php
+++ b/src/scoretable.php
@@ -316,9 +316,10 @@ if($redo) {
$_SESSION["scoreblink"][$score[$e]["username"]."-".$score[$e]["site"]]=0;
if( $score[$e]["userflag"] != '')
$strtmp .= " <td nowrap><img alt=\"" . $score[$e]["userflag"]. "\" width=\"18\" src=\"" . $loc. '/images/flags/' .
- $score[$e]["userflag"] . ".png\"> " . $score[$e]["username"]."/".$score[$e]["site"] . " </td>";
+ $score[$e]["userflag"] . ".png\"> " . $score[$e]["username"]."/".$score[$e]["usersitename"] . " </td>";
else
- $strtmp .= " <td nowrap>" . $score[$e]["username"]."/".$score[$e]["site"] . " </td>";
+ $strtmp .= " <td nowrap>" . $score[$e]["username"]."/".$score[$e]["usersitename"] . " </td>";
+
if($score[$e]['usershortinstitution'] != '')
$strtmp .= "<td>[" . $score[$e]['usershortinstitution'] . '] ' . $score[$e]["userfullname"];
else