NEW FEATURE: use php session
[e-DoKo.git] / output.php
index f22c6df6962c344ea217ad13dfc48640cdcc310b..9919a97a56f754f3a73f91dfb3feda2538b4a6f1 100644 (file)
@@ -14,14 +14,8 @@ function display_links($email,$password)
 
 function output_link_to_user_page($email,$password)
 {
-  echo "<div class=\"over\">\n";
-  echo "<form action=\"index.php\" method=\"post\">\n";
-  echo "  <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
-  echo "  <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
-  echo "  <input type=\"submit\" class=\"submitbutton\" value=\"go to my user page\" />\n";
-  echo "</form>\n";
-  echo "</div>\n";
-  
+  echo "<a href=\"index.php\"> go to my user page </a>";
+
   return;
 }
 
@@ -31,25 +25,15 @@ function output_user_settings($email,$password)
 
   echo "<div class=\"useroptions\">\n";
   echo "<h4> Settings </h4>\n";
-  echo "<form action=\"index.php\" method=\"post\">\n";
-  echo "  <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
-  echo "  <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
-  echo "  <input type=\"hidden\" name=\"passwd\"  value=\"ask\" />\n";
-  echo "  <input type=\"submit\" class=\"submitbutton\" name=\"pass\" value=\"change password\" /> <br />\n";
-  echo "</form>\n";
-  echo "<form action=\"index.php\" method=\"post\">\n";
-  echo "  <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
-  echo "  <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
-  echo "  <input type=\"hidden\" name=\"setpref\"  value=\"englishcards\" />\n";
-  echo "  <input type=\"submit\" class=\"submitbutton\" value=\"use english cards\" /> <br />\n";
-  echo "</form>\n";
-  echo "<form action=\"index.php\" method=\"post\">\n";
-  echo "  <input type=\"hidden\" name=\"email\" value=\"".$email."\" />\n";
-  echo "  <input type=\"hidden\" name=\"password\" value=\"".$password."\" />\n";
-  echo "  <input type=\"hidden\" name=\"setpref\"  value=\"germancards\" />\n";
-  echo "  <input type=\"submit\" class=\"submitbutton\" value=\"use german cards\" /> <br />\n";
-  echo "</form>\n";
+  echo "<a href=\"index.php?passwd=ask\">change password</a><br /";
+
+  if( $PREF["cardset"] == "english" )
+    echo "<a href=\"index.php?setpref=germancards\">use german cards</a><br />";
+  else
+    echo "<a href=\"index.php?setpref=englishcards\">use english cards</a> <br />";
+
   echo "</div>\n";
+
   return;
 }
 
@@ -256,20 +240,14 @@ function output_check_for_sickness($me,$mycards)
   return;
 }
 
-function check_want_to_play($me)
+function output_check_want_to_play($me)
 {
    ?>
  <form action="index.php" method="post">
    Do you want to play a game of DoKo?
    yes<input type="radio" name="in" value="yes" />
    no<input type="radio" name="in" value="no" /> <br />
-
 <?php   
-/*
-   Do you want to get an email for every card played or only if it your move?
-   every card<input type="radio" name="update" value="card" />
-   only on my turn<input type="radio" name="update" value="turn" /> <br />
-*/
   echo "<input type=\"hidden\" name=\"me\" value=\"$me\" />\n";
   echo "\n";
   echo "<input type=\"submit\" value=\"count me in\" />\n";
@@ -380,8 +358,6 @@ function output_header()
   return;
 }
 
-
-
 function output_footer()
 {
   global $REV,$PREF;
@@ -406,6 +382,17 @@ function output_footer()
   return;
 }
 
+function output_status($name)
+{
+  echo "<div class=\"status\">\n";
+  echo $name;
+  echo " <a href=\"index.php?logout=1\">logout</a>\n";
+  echo "</div>";
+
+  return;
+}
+
+
 function output_password_recovery($email,$password)
 {
 ?>