Created
June 26, 2010 18:46
-
-
Save syranez/454259 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Färbt die Tipps entsprechend des Ergebnisses farbig ein. | |
# | |
# Argumente | |
# 1: ID des Spiels | |
# | |
# Return | |
# HTML-String <span><font>FIRST_SCORE</font> : <font>SECOND_SCORE</font></span> | |
# | |
# Gibt es keinen Tipp für eine Begegnung, so wird ein Nullstring zurückgegeben. | |
# Ansonsten wird der Tipp des Spielers mit dem Ergebnis verglichen und je nach | |
# Ausgang farbig gefärbt. | |
sub colourTip { | |
my $MatchID = shift; | |
my $color = "black"; | |
if ( ! isGamerDataAvailable($MatchID) ) | |
return ""; | |
my $comp = compareTipAndResult($MatchID); | |
switch ( $comp ) | |
{ | |
case 0: | |
# kein korrekter Tip | |
$color = "red"; | |
break; | |
case 1: | |
# Tendenz richtig | |
$color = "orange"; | |
break; | |
case 2: | |
# richtiger Tipp | |
$color = "green"; | |
break; | |
} | |
return "<span> \ | |
<font style=\"color:".$color."\">$gd{FIRST_SCORE}</font> \ | |
: \ | |
<font style=\"color:".$color."\">$gd{SECOND_SCORE}</font> \ | |
</span>"; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment