- print "\t\t<entry>\n"
- . "\t\t\t<position>" . ++$position . "</position>\n"
- . "\t\t\t<user-id>" . $score->getUser()->id() . "</user-id>\n"
- . "\t\t\t<user-name>" . $score->getUser()->getName() . "</user-name>\n"
- . "\t\t\t<score>" . $score->getGscore() . "</score>\n"
- . "\t\t</entry>\n";
+ print "<!DOCTYPE HTML>\n"
+ . "<html>\n\t<head>\n"
+ . "\t\t" . '<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />'
+ . "\n\t\t" . '<link href="style.css" rel="stylesheet" type="text/css" />'
+ . "\n\t\t<title>TIM Game High Scores</title>\n"
+ . "\t</head>\n\t<body>\n\t\t<h1>TIM Game High Scores</h1>\n";
+ foreach ($myScores AS $score)
+ {
+ print "\t\t<div class=\"entrywrap\">\n\t\t\t<div class=\"entry\">\n"
+ . "\t\t\t\t<div class=\"position\">" . ++$position . "</div>\n"
+ . "\t\t\t\t<span class=\"user\">" . $score->getUser()->getName() . "</span>\n"
+ . "\t\t\t\t<span class=\"score\">" . $score->getGscore() . "</span>\n"
+ . "\t\t\t</div>\n\t\t</div>\n";
+ }
+ print "\t</body>\n</html>\n";
+ }
+ else
+ {
+ print "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<message>\n\t<scores>\n";
+ foreach ($myScores AS $score)
+ {
+ print "\t\t<entry>\n"
+ . "\t\t\t<position>" . ++$position . "</position>\n"
+ . "\t\t\t<user-id>" . $score->getUser()->id() . "</user-id>\n"
+ . "\t\t\t<user-name>" . $score->getUser()->getName() . "</user-name>\n"
+ . "\t\t\t<score>" . $score->getGscore() . "</score>\n"
+ . "\t\t</entry>\n";
+ }
+ print "\t</scores>\n</message>\n";