From c44e3cfcc5f363f001b101a82b1c06bfa7b05e69 Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sat, 4 Aug 2007 09:52:56 -0700 Subject: [PATCH] LAYOUT: fixed some overlaying of boxes (but not all), made userpage a bit nicer a bit more html on the user page and the session are displayed differently now. Also fixed a few small html errors, moved the link for new games into the menu and probably some small things I don't remember right now ;) --- css/standard.css | 32 ++++++++-------------- functions.php | 3 ++ index.php | 71 ++++++++++++++++++++++++++++-------------------- output.php | 2 +- 4 files changed, 57 insertions(+), 51 deletions(-) diff --git a/css/standard.css b/css/standard.css index 5bca2ae..32060e2 100644 --- a/css/standard.css +++ b/css/standard.css @@ -7,6 +7,8 @@ .main { min-height: 40em; +// margin-left: 12.5em; +// margin-right: 12.5em; } .footer { @@ -294,10 +296,11 @@ ul.tricks li div div span.comment span{ text-align:center; } -.gameinfo { - position:absolute; - top:9em; - right:0em; +.gameinfo, .useroptions { + float:right; + margin:1em; + margin-top:3em; + margin-right:0em; width:12em; @@ -310,11 +313,11 @@ ul.tricks li div div span.comment span{ background-color: #eee; } - .usermenu { - position:absolute; - top:9em; - left:0em; + float: left; + margin:1em; + margin-top:3em; + margin-left:0em; width: 12em; @@ -341,19 +344,6 @@ ul.tricks li div div span.comment span{ background-color:#afa; } -.useroptions{ - float:right; - padding-left:0.3em; - border-left: 1px solid #aaa; - border-bottom: 1px solid #aaa; -} -.useroptions h4 { - margin:0.1em; - margin-left:0em; - padding:0.1em; - padding-left:0em; - text-align:left; -} .cardinput { display:inline; diff --git a/functions.php b/functions.php index 57945ef..45fa0ae 100644 --- a/functions.php +++ b/functions.php @@ -821,6 +821,9 @@ function display_user_menu() echo "game ".DB_format_gameid($r[1])."
\n"; } + echo "
start a new game"; + + echo "
Report bugs in the wiki\n"; echo "\n"; diff --git a/index.php b/index.php index cfef15b..c2d93d2 100644 --- a/index.php +++ b/index.php @@ -1574,14 +1574,14 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) { $ok = 1; - $uid = DB_get_userid_by_email($email); - if(!$uid) + $myid = DB_get_userid_by_email($email); + if(!$myid) $ok = 0; if($ok) { /* check how many entries in recovery table */ - $number = DB_get_number_of_passwords_recovery($uid); + $number = DB_get_number_of_passwords_recovery($myid); /* if less than N recent ones, add a new one and send out email */ if( $number < 5 ) @@ -1605,7 +1605,7 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) " also still be valid until you set a new one\n"; mymail($email,$EmailName."recovery ",$message); - DB_set_recovery_password($uid,md5($newpw)); + DB_set_recovery_password($myid,md5($newpw)); } else { @@ -1632,13 +1632,13 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) $password = md5($password); $ok = 1; - $uid = DB_get_userid_by_email_and_password($email,$password); - if(!$uid) + $myid = DB_get_userid_by_email_and_password($email,$password); + if(!$myid) $ok = 0; if($ok) { - DB_get_PREF($uid); + DB_get_PREF($myid); if(myisset("setpref")) { @@ -1648,12 +1648,12 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) case "germancards": case "englishcards": $result = mysql_query("SELECT * from User_Prefs". - " WHERE user_id='$uid' AND pref_key='cardset'" ); + " WHERE user_id='$myid' AND pref_key='cardset'" ); if( mysql_fetch_array($result,MYSQL_NUM)) $result = mysql_query("UPDATE User_Prefs SET value=".DB_quote_smart($setpref). - " WHERE user_id='$uid' AND pref_key='cardset'" ); + " WHERE user_id='$myid' AND pref_key='cardset'" ); else - $result = mysql_query("INSERT INTO User_Prefs VALUES(NULL,'$uid','cardset',". + $result = mysql_query("INSERT INTO User_Prefs VALUES(NULL,'$myid','cardset',". DB_quote_smart($setpref).")"); echo "Ok, changed you preferences for the cards.\n"; break; @@ -1690,7 +1690,7 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) case '1': echo "Changed the password.
"; mysql_query("UPDATE User SET password='".md5($_REQUEST["password1"]). - "' WHERE id=".DB_quote_smart($uid)); + "' WHERE id=".DB_quote_smart($myid)); break; } /* set password */ @@ -1698,10 +1698,10 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) } else /* output default user page */ { - $time = DB_get_user_timestamp($uid); + $time = DB_get_user_timestamp($myid); $unixtime = strtotime($time); - $offset = DB_get_user_timezone($uid); + $offset = DB_get_user_timezone($myid); $zone = return_timezone($offset); date_default_timezone_set($zone); @@ -1716,17 +1716,20 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) echo "last login: ".date("r",$unixtime)."
"; - DB_update_user_timestamp($uid); - - echo "

These are your games that haven't started yet:
\n"; + DB_update_user_timestamp($myid); + + display_user_menu(); + + echo "

These are your games that haven't started yet:

\n"; $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.mod_date,Game.player from Hand". " LEFT JOIN Game On Hand.game_id=Game.id". - " WHERE Hand.user_id='$uid' AND Game.status='pre'". + " WHERE Hand.user_id='$myid' AND Game.status='pre'". " ORDER BY Game.session" ); + echo "

\n"; while( $r = mysql_fetch_array($result,MYSQL_NUM)) { echo "game ".DB_format_gameid($r[1])." "; - if($r[3]==$uid || $r[3]==NULL) + if($r[3]==$myid || $r[3]==NULL) echo "(it's your turn)\n"; else { @@ -1742,17 +1745,18 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) } echo "

\n"; - echo "

These are the games you are playing in:
\n"; + echo "

These are the games you are playing in:

\n"; $result = mysql_query("SELECT Hand.hash,Hand.game_id,Game.mod_date,Game.player from Hand". " LEFT JOIN Game On Hand.game_id=Game.id". - " WHERE Hand.user_id='$uid' AND Game.status='play'". + " WHERE Hand.user_id='$myid' AND Game.status='play'". " ORDER BY Game.session" ); + echo "

\n"; while( $r = mysql_fetch_array($result,MYSQL_NUM)) { echo "game ".DB_format_gameid($r[1])." "; if($r[3]) { - if($r[3]==$uid) + if($r[3]==$myid) echo "(it's your turn)\n"; else { @@ -1769,22 +1773,31 @@ else if( myisset("email","password") || isset($_SESSION["name"]) ) echo "

\n"; - echo "

And these are your games that are already done:
Game: \n"; + echo "

And these are your games that are already done:

\n"; + echo "

Session:\n"; $output = array(); $result = mysql_query("SELECT hash,game_id from Hand". " LEFT JOIN Game ON Game.id=Hand.game_id". - " WHERE user_id='$uid' AND Game.status='gameover'". + " WHERE user_id='$myid' AND Game.status='gameover'". " ORDER BY Game.session,Game.create_date" ); + $gamenrold = 0; + echo "
\n"; while( $r = mysql_fetch_array($result,MYSQL_NUM)) - $output[] = "".DB_format_gameid($r[1])." "; - echo implode(", ",$output)."

\n"; - + { + $game = DB_format_gameid($r[1]); + $gamenr = (int) $game; + if($gamenrold < $gamenr) + { + $gamenrold = $gamenr; + echo "
$gamenr: "; + } + echo "I "; + } + echo "

\n"; $names = DB_get_all_names(); - echo "

Registered players:
\n"; + echo "

Registered players:

\n

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

\n"; - - echo "

Want to start a new game? Visit this page.

"; } } else diff --git a/output.php b/output.php index 4485db4..88bc9f2 100644 --- a/output.php +++ b/output.php @@ -8,7 +8,7 @@ function output_user_settings($email,$password) echo "
\n"; echo "

Settings

\n"; - echo "change password
change password
"; if( $PREF["cardset"] == "english" ) echo "use german cards
"; -- 2.25.1