diff options
author | Arun Persaud <arun@nubati.net> | 2007-12-16 14:54:06 +0100 |
---|---|---|
committer | Arun Persaud <arun@nubati.net> | 2007-12-16 22:33:43 +0100 |
commit | a28cbfa660f2ff982f1cdcee41c09cec772d84af (patch) | |
tree | e2c70082d93a44b373b6d57899590ac01dcc0d5c /output.php | |
parent | 672791e22e1de68e278e2f0d5c6d7331d5994ecb (diff) | |
download | e-DoKo-a28cbfa660f2ff982f1cdcee41c09cec772d84af.tar.gz e-DoKo-a28cbfa660f2ff982f1cdcee41c09cec772d84af.tar.bz2 e-DoKo-a28cbfa660f2ff982f1cdcee41c09cec772d84af.zip |
BUGFIX: time display used wrong timezones. also optimized things a bit
Got rid of a few db-queries for getting the right timezone. The timezone was also set after the timefunction was called and therefore the timezone didn't have any effect.
Diffstat (limited to 'output.php')
-rw-r--r-- | output.php | 29 |
1 files changed, 23 insertions, 6 deletions
@@ -267,7 +267,7 @@ function output_home_page($pre,$game,$done,$avgtime) echo "$done games have been completed on this server. Average time of a game: $avgtime days</p>"; ?> - <p> Please <a href="register.php">register</a>, in case you haven't done that yet <br /> + <p> Please <a href="register.php">register</a>, in case you have not done that yet <br /> or login with you email-address or name and password here: </p> <form action="index.php" method="post"> @@ -333,8 +333,29 @@ function output_header() <div class="header"> <h1> Welcome to E-Doko <sup style="color:#888;">(beta)</sup> </h1> </div> -<div class="main"> <?php + if(isset($_SESSION["name"])) + { + $name = $_SESSION["name"]; + + /* logout info */ + echo "<div class=\"status\">\n"; + echo $name; + echo " <a href=\"index.php?logout=1\">logout</a>\n"; + echo "</div>"; + + /* last logon time */ + $myid = DB_get_userid_by_name($name); + $zone = DB_get_user_timezone($myid); + date_default_timezone_set($zone); + + $time = DB_get_user_timestamp($myid); + $unixtime = strtotime($time); + + echo "<div class=\"lastlogin\">last login: ".date("r",$unixtime)."</div>"; + }; + + echo "<div class=\"main\">"; return; } @@ -365,10 +386,6 @@ function output_footer() function output_status($name) { - echo "<div class=\"status\">\n"; - echo $name; - echo " <a href=\"index.php?logout=1\">logout</a>\n"; - echo "</div>"; return; } |