From acf6c5f97944366952e6b373a4d59cecd08b658e Mon Sep 17 00:00:00 2001 From: Arun Persaud Date: Sun, 16 Dec 2007 23:50:35 +0100 Subject: LAYOUT: last login and logout text where displayed incorrectly sometimes in a previous commit I moved those tings to the output_header function. Turns out you can't do that, so here is the fix. --- output.php | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) (limited to 'output.php') diff --git a/output.php b/output.php index 29fd8f3..5d84d46 100644 --- a/output.php +++ b/output.php @@ -334,26 +334,6 @@ function output_header()

Welcome to E-Doko (beta)

\n"; - echo $name; - echo " logout\n"; - echo ""; - - /* 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 "
last login: ".date("r",$unixtime)."
"; - }; echo "
"; return; @@ -384,9 +364,28 @@ function output_footer() return; } -function output_status($name) +function output_status() { + if(isset($_SESSION["name"])) + { + $name = $_SESSION["name"]; + + /* logout info */ + echo "
\n"; + echo $name; + echo " logout\n"; + echo "
"; + /* 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 "
last login: ".date("r",$unixtime)."
"; + }; return; } -- cgit v1.2.3-18-g5258