"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
- <title>e-Doko</title>
+ <title>e-DoKo</title>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type" />
- <link rel="stylesheet" type="text/css" href="standard.css" />
+ <link rel="stylesheet" type="text/css" href="http://doko.nubati.net/css/standard.css" />
<script type="text/javascript">
function hl(num) {
if(document.getElementById){
</head>
<body onload="high_last();">
<div class="header">
-<h1> Welcome to E-Doko </h1>
+<h1> Welcome to E-DoKo </h1>
<?php
/*
* config
*/
-$host = "http://doko.nubati.net/index.php";
+$base = "http://doko.nubati.net/";
+$host = $base."index.php";
$wiki = "http://wiki.nubati.net/index.php?title=EmailDoko";
-$debug = 1;
+$debug = 0;
$last=-2;
echo "</div>\n";
/* end header */
-
/* helper function */
function mymail($To,$Subject,$message)
* convert even cards to the matching odd value */
if( $card/2 - (int)($card/2) == 0.5)
- echo "<img src=\"cards/".$card.".png\" alt=\"".card_to_name($card)."\" />\n";
+ echo "<img src=\"".$base."cards/".$card.".png\" alt=\"".card_to_name($card)."\" />\n";
else
- echo "<img src=\"cards/".($card-1).".png\" alt=\"".card_to_name($card-1)."\" />\n";
+ echo "<img src=\"".$base."cards/".($card-1).".png\" alt=\"".card_to_name($card-1)."\" />\n";
return;
}
function display_link_card($card,$me)
{
if( $card/2 - (int)($card/2) == 0.5)
- echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"cards/".$card.".png\" alt=\"\" />\n";
+ echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"".$base."cards/".$card.".png\" alt=\"\" />\n";
else
- echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"cards/".($card-1).".png\" alt=\"\" />\n";
+ echo "<input type=\"radio\" name=\"card\" value=\"".$card."\" /><img src=\"".$base."cards/".($card-1).".png\" alt=\"\" />\n";
return;
}
/***************** M A I N **************************/
-
$history=array();
/* check for status file and read it, if possible */
else
die("no random file");
- $randomNR = explode( ":", $random[2] );
+ $randomNR = explode( ":", $random[4] );
/* write initial status into file */
$output = fopen("status.txt","w");
/* found old trick, display it */
if(sizeof($trick)==5)
- echo " <li onclick=\"hl('$j');\"><a href=\"#\">Trick $j</a>\n <div class=\"table\" id=\"trick".$j."\">\n <img class=\"table\" src=\"pics/table".$play[0].".png\" alt=\"table\" />\n";
+ echo " <li onclick=\"hl('$j');\"><a href=\"#\">Trick $j</a>\n <div class=\"table\" id=\"trick".$j."\">\n <img class=\"table\" src=\"".$base."pics/table".$play[0].".png\" alt=\"table\" />\n";
else
{
/* display current trick */
- echo "<li onclick=\"hl('$j');\"><a href=\"#\">Current Trick</a>\n <div class=\"table\" id=\"trick".$j."\">\n <img class=\"table\" src=\"pics/table".$play[0].".png\" alt=\"table\" />";
+ echo "<li onclick=\"hl('$j');\"><a href=\"#\">Current Trick</a>\n <div class=\"table\" id=\"trick".$j."\">\n <img class=\"table\" src=\"".$base."pics/table".$play[0].".png\" alt=\"table\" />";
}
for($i=0;$i<sizeof($trick)-1;$i++)
{
echo " </div>\n </li>\n";
}
- echo "</ul>\n";
+ echo "</ul> <hr />\n";
echo "<div class=\"line\"></div>";
if(strlen($player[$hash[0]]["cards"]))
$history[] = "\n".$win.":\n"; /* not sure why I need the first \n here */
+ /* check if game is done */
+ $end = 1;
+ for($i=0;$i<4;$i++)
+ if(strlen(trim($player[$hash[$i]]["cards"]))!=0)
+ $end = 0;
+
/* email the player who needs to move next*/
+ if(!$end)
for($i=0;$i<4;$i++)
{
if((ereg("c",$player[$hash[$i]]["option"]) || $i==$win) )