fixed the new sorting algorithm
[e-DoKo.git] / index.php
index 5bc9e4526803a8828d3b02f3f238e72ac063014b..6353f34280feafae3a4a378312bcfc9ebf79a617 100644 (file)
--- a/index.php
+++ b/index.php
@@ -1,6 +1,9 @@
 <?php
 error_reporting(E_ALL);
 
+global $REV;
+$REV  ="\$Rev$";
+
 include_once("config.php");      
 include_once("output.php");      /* html output only */
 include_once("db.php");          /* database only */
@@ -107,7 +110,9 @@ else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD" ))
     mymail($EmailB,"You are invited to a game of DoKo","Hello $PlayerB,\n".$message.$hashB);
     mymail($EmailC,"You are invited to a game of DoKo","Hello $PlayerC,\n".$message.$hashC);
     mymail($EmailD,"You are invited to a game of DoKo","Hello $PlayerD,\n".$message.$hashD);
-        
+
+    
+    echo "You started a new game. The emails have been sent out!";    
   }    
 /* end set up a new game */
 
@@ -189,7 +194,7 @@ else if(myisset("me"))
        echo "checking if you selected solo or nines...<br />".
          " if you have a wedding, please send an email to the other players. <br />".
          " if you have poverty you need to play a normal game,sorry...<br />".
-         " At the moment you need to reload this page to finish the setup.<br />";
+         " Please click <a href=\"$host?me=$me\">here</a> to finish the setup.<br />";
        if(!myisset("solo","wedding","poverty","nines") )
          {
            /* all these variables have a pre-selected default,
@@ -249,7 +254,7 @@ else if(myisset("me"))
         * tell people about it.
         */
        echo "<br />checking if someone else selected solo or nines... wedding and poverty not handled at the moment<br />".
-          "reload this page to finish the setup <br />";
+         " Please click <a href=\"$host?me=$me\">here</a> to finish the setup.<br />";  
        
        /* only set this after all poverty, etc. are handeled*/
        DB_set_hand_status_by_hash($me,'play');
@@ -432,7 +437,7 @@ else if(myisset("me"))
        
        $play = array(); /* needed to calculate winner later  */
        $seq  = 1;          
-       $pos  = 0;
+       $pos  = DB_get_startplayer_by_gameid($gameid)-1; 
        $firstcard = ""; /* first card in a trick */
        
        echo "\n<ul class=\"tricks\">\n";
@@ -662,7 +667,7 @@ else if(myisset("me"))
          }
        
        $mycards = DB_get_hand($me);
-       sort($mycards);
+       $mycards = mysort($mycards,$gametype);
        echo "<div class=\"mycards\">\n";
        
        if($myturn && !myisset("card"))