BUGIFX+LAYOUT: gameids where still in the player menu; show table for new game setup
authorArun Persaud <arun@nubati.net>
Mon, 30 Jul 2007 02:12:11 +0000 (19:12 -0700)
committerArun Persaud <arun@nubati.net>
Mon, 30 Jul 2007 02:12:11 +0000 (19:12 -0700)
fixed last commit.
for new games, the table is now shown and one can select the place people are sitting
better.

css/standard.css
functions.php
index.php
output.php

index 9eb54e7437a10958a2ca377ebe515c833aa5170c..5bca2aea8a422816fcb58e7f14287ce28cb341e1 100644 (file)
@@ -37,7 +37,9 @@
  text-align: center;
 }
 
-
+.rules {
+margin-top:20em;
+}
 
 
 .card { 
index d738b0042910602fed7f35a7e2dc28cee38b535b..57945ef980ed863758a828f609f828809f955e13 100644 (file)
@@ -818,7 +818,7 @@ function display_user_menu()
 
   while( $r = mysql_fetch_array($result,MYSQL_NUM))
     {
-      echo "<a href=\"".$host."?me=".$r[0]."\">game #".$r[1]." </a><br />\n";
+      echo "<a href=\"".$host."?me=".$r[0]."\">game ".DB_format_gameid($r[1])." </a><br />\n";
     }
   
   echo
index 71d40506c27d5cd52d2000b8dad41714ecd8fda7..57145c6d978ff2669a42a2497aba474d288806a6 100644 (file)
--- a/index.php
+++ b/index.php
@@ -33,8 +33,15 @@ if(myisset("logout"))
   }
 else if(myisset("new"))
   {
-    $names = DB_get_all_names();
-    output_form_for_new_game($names);
+    if( isset($_SESSION["name"]) )
+      {
+       $names = DB_get_all_names();
+       output_form_for_new_game($names);
+      }
+    else
+      {
+       echo "Please log in.";
+      }
   }
 /*check if everything is ready to set up a new game */
  else if( myisset("PlayerA", "PlayerB","PlayerC","PlayerD","dullen","schweinchen","call" ))
index ddea3b83c0e5980b488a73973404a3abc23043f3..4485db430ef888223b12d5c0246407874b4ac6cc 100644 (file)
@@ -44,13 +44,19 @@ function output_form_for_new_game($names)
     <h2> Players </h2>
     <p>Please select four players (or use the randomly pre-selected names)</p>
        <form action="index.php" method="post">
+
+   <div class="table">
+     <img src="pics/table.png" alt="table" />
 <?php
     /* ask for player names */
+    $i=0;
   foreach( array("PlayerA","PlayerB","PlayerC","PlayerD") as $player)
   {
     srand((float) microtime() * 10000000);
     $randkey = array_rand($names);
     $rand = $names[$randkey];
+    echo  "<span class=\"table".$i."\">";
+    $i++;
     echo "    Name:  <select name=\"$player\" size=\"1\" />  \n";
     foreach($names as $name)
     {
@@ -61,10 +67,11 @@ function output_form_for_new_game($names)
       else
        echo "     <option>$name</option>\n";
     }
-    echo "  </select>\n";
+    echo "  </select></span>\n";
    }
 ?>   
-   <h2> Rules </h2> 
+    </div>
+   <h2 class="rules"> Rules </h2> 
       <p> Some areas are grayed out which means that the rule is not implemented yet and therefore cannot be selected </p>
       <p> ten of hearts: 
          <ul>