From eb20bf1a0cae1192eb50c19220e72df8d971d8e7 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 18 Oct 2008 11:33:36 -0700 Subject: NEW FEATURE: make it possible to view games where people played with the same hand had to change a few things and check more often if people are logge in, so that for example personal notes only show up when you are logged in and not when someone else is looking at your cards Signed-off-by: Arun Persaud --- include/user.php | 46 +++++++++++++++++++++++++--------------------- 1 file changed, 25 insertions(+), 21 deletions(-) (limited to 'include/user.php') diff --git a/include/user.php b/include/user.php index 19eb27b..dc96377 100644 --- a/include/user.php +++ b/include/user.php @@ -1,12 +1,12 @@ ". @@ -81,30 +81,30 @@ if(myisset("forgot")) "or else try again."; } } -else +else { /* normal user page */ - + /* verify password and email */ if(strlen($password)!=32) $password = md5($password); - + $ok = 1; $myid = DB_get_userid('email-password',$email,$password); if(!$myid) $ok = 0; - + if($ok) { /* user information is ok */ $myname = DB_get_name('email',$email); $_SESSION["name"] = $myname; - + $PREF = DB_get_PREF($myid); - + DB_update_user_timestamp($myid); - + display_user_menu(); - + /* display all games the user has played */ echo "
"; echo "

These are all your games:

\n"; @@ -113,12 +113,15 @@ else echo "P = game in progess "; echo "F = game finished
"; echo "

\n"; - + $output = array(); - $result = DB_query("SELECT Hand.hash,Hand.game_id,Game.mod_date,Game.player,Game.status from Hand". - " LEFT JOIN Game ON Game.id=Hand.game_id". + $result = DB_query("SELECT Hand.hash,Hand.game_id,G.mod_date,G.player,G.status, ". + " (SELECT count(H.randomnumbers) FROM Game H WHERE H.randomnumbers=G.randomnumbers) AS count ". + " FROM Hand". + " LEFT JOIN Game G ON G.id=Hand.game_id". " WHERE user_id='$myid'". - " ORDER BY Game.session,Game.create_date" ); + " ORDER BY G.session,G.create_date" ); + $gamenrold = -1; echo "\n \n\n
\n"; while( $r = DB_fetch_array($result)) @@ -134,12 +137,13 @@ else $gamenrold = $gamenr; echo "\n"; } + $Multi = ($r[5]>1) ? "multi" : ""; if($r[4]=='pre') - echo " p \n"; + echo " p \n"; else if ($r[4]=='gameover') - echo " F \n"; + echo " F \n"; else - echo " P \n"; + echo " P \n"; if($r[4] != 'gameover') { echo "\n "; @@ -160,19 +164,19 @@ else } } echo "
\n"; - + /* display last 5 users that have signed up to e-DoKo */ $names = DB_get_names_of_new_logins(5); echo "

New Players:

\n

\n"; echo implode(", ",$names).",...\n"; echo "

\n"; - + /* display last 5 users that logged on */ $names = DB_get_names_of_last_logins(5); echo "

Players last logged in:

\n

\n"; echo implode(", ",$names).",...\n"; echo "

\n"; - + echo "
\n"; } else -- cgit v1.2.3-18-g5258