small fixes, typo, etc
authorarun <arun@nubati.net>
Mon, 4 Jun 2007 12:51:02 +0000 (12:51 +0000)
committerarun <arun>
Mon, 4 Jun 2007 12:51:02 +0000 (12:51 +0000)
index.php
output.php

index 0bb04d4c0044e4f37e234a3cd17d58e9191783b7..8b91b69c1623cc0faaaa87c5e5a402e452a20a1c 100644 (file)
--- a/index.php
+++ b/index.php
@@ -62,6 +62,7 @@ if(myisset("new"))
       {
        echo "couldn't find one of the names, please start a new game";
        output_footer();
+       DB_close();
        exit();
       }
     
@@ -80,6 +81,7 @@ if(myisset("new"))
       {
        echo "Error defining ruleset: $ruleset";
        output_footer();
+       DB_close();
        exit();
       };
     
@@ -172,6 +174,7 @@ else if(myisset("cancle","me"))
        echo "Can't find you in the database, please check the url.<br />\n";
        echo "perhaps the game has been cancled, check by login in <a href=\"$host\">here</a>.";
        output_footer();
+       DB_close();
        exit();
       }
     
@@ -217,6 +220,7 @@ else if(myisset("me"))
        echo "Can't find you in the database, please check the url.<br />\n";
        echo "perhaps the game has been cancled, check by login in <a href=\"$host\">here</a>.";
        output_footer();
+       DB_close();
        exit();
       }
 
@@ -531,6 +535,7 @@ else if(myisset("me"))
              echo "The game has been canceled because ".DB_get_name_by_userid($nines).
                " has five or more nines and nobody is playing solo.\n";
              output_footer();
+             DB_close();
              exit();
            }
          else if($poverty==1)
@@ -900,6 +905,7 @@ else if(myisset("me"))
          
          echo "<p style=\"background-color:red\";>Game $gameid has been cancled.<br /><br /></p>";
          output_footer();
+         DB_close();
          exit();
        }
 
@@ -1539,6 +1545,7 @@ else if(myisset("me"))
       echo "error in testing the status";
     }
     output_footer();
+    DB_close();
     exit();
  } 
 /* user status page */ 
@@ -1667,15 +1674,15 @@ else if(myisset("me"))
               
               
               echo "<p>and these are your games that are already done:<br />Game: \n";
+              $output=array();
               $result = mysql_query("SELECT hash,game_id from Hand WHERE user_id='$uid' AND status='gameover'" );
               while( $r = mysql_fetch_array($result,MYSQL_NUM))
-                echo "<a href=\"".$host."?me=".$r[0]."\">#".$r[1]." </a>, ";
-              echo "</p>\n";
+                $output[]= "<a href=\"".$host."?me=".$r[0]."\">#".$r[1]." </a>";
+              echo implode(", ",$output)."</p>\n";
               
               $names = DB_get_all_names();
               echo "<p>registered players:<br />\n";
-              foreach ($names as $name)
-                echo "$name, \n";
+              echo implode(", ",$names)."\n";
               echo "</p>\n";
               
               echo "<p>Want to start a new game? Visit <a href=\"".$host."?new\">this page.</a></p>";
@@ -1687,6 +1694,7 @@ else if(myisset("me"))
         }
      };
      output_footer();
+     DB_close();
      exit();
    }
 /* page for registration */
index 0871bcc1d0fca5719cd2491b0363333f857fbe95..9cadcb001b1d0c0048a8bb7d6d5182b19f45156a 100644 (file)
@@ -64,8 +64,7 @@ function output_user_settings($email,$password)
 function output_register()
 {
   echo "IMPORTANT: passwords are going over the net as clear text, so pick an easy password. No need to pick anything complicated here ;)<br /><br />";
-  echo "TODO: convert timezone into a menu<br />\n";
-  echo "TODO: figure out a way to handle passwords <br />\n";
+  echo "TODO: figure out a better way to handle passwords <br />\n";
   ?>
         <form action="index.php" method="post">
           <fieldset>
@@ -83,7 +82,12 @@ function output_register()
               </tr><tr>
               <td><label for="Rtimezone">Timezone:</label></td>
                <td>
-                  <input type="text" id="Rtimezone" name="Rtimezone" size="4" maxsize="4" value="+1" />
+                 <select id="Rtimezone" name="Rtimezone" size="1">
+                     <option value="1">Berlin</option>
+                     <option value="-8">Berkeley</option>
+                     <option value="13">Wellington</option>
+                 </select>
+                (If your timezone is not listed, just select whatever you want and email the admin your correct time zone.)
               </td>
               </tr><tr>
                <td colspan="2"> <input type="submit" value="register" /></td>