Forgot Password / Register
Site Statistics
Total Members: 520
Total Tutorials: 242
Newsest User: 8884244477
Todays Unique Hits: 398
0 Users 5 Guests Online

Last Seen

First off you will need to run the following query in phpMyAdmin.
Code

ALTER TABLE `members`
ADD `last_seen` VARCHAR( 255 ) NOT NULL default 'Never';


Next open your login.php and find
Code

$query = mysql_query("SELECT * FROM `members` WHERE `username` = '$username'") or die(mysql_error());
//fetchs the sql
$user = mysql_fetch_array($query);


Add Under:
Code

$last_date = date("l, F j, Y h:i A");
$update = mysql_query("UPDATE `members` SET `last_seen` = '$last_date' WHERE `username` = '$user[username]' AND `id` = '$user[id]';") or die(mysql_error());

set up the date and edit the mySQL table :D

Now open members.php and find:
Code

<b>$user[username]'s Profile</b><br><br>


Add After:
Code

Last Seen: $user[last_seen]<br>


This will enable users to see when the user was last online/ last logged in.

That should be it.
ShadowMage
Author:
Views:
2522
Rating:
Posted on Friday 18th April 2008 at 02:19 PM
schorsch
schorsch
You can customize the script so that it displays on the login.php visible for guests who last line was, and although it
Last Online

Schorsch before 5 minutes

Sepp before 10 minutes

Hans 3 weeks
Do I? Because someone can help me?
Posted on Wednesday 9th April 2008 at 05:59 PM
Dalez
Dalez
Thanks, i think it works xD
Posted on Saturday 4th August 2007 at 01:01 AM
ShadowMage
ShadowMage
whats that?
Posted on Friday 3rd August 2007 at 10:49 AM
gbt91
gbt91
uhm..i've got an idea :S
Posted on Sunday 1st July 2007 at 04:44 PM
cyruswu
cyruswu
Thanks....
Posted on Sunday 1st July 2007 at 04:36 PM
ShadowMage
ShadowMage
sent in PM
Posted on Sunday 1st July 2007 at 04:22 PM
cyruswu
cyruswu
NP. Read my shoutbox post.
Posted on Sunday 1st July 2007 at 04:05 PM
ShadowMage
ShadowMage
thanks
Posted on Sunday 1st July 2007 at 03:43 PM
cyruswu
cyruswu
Great job. Mod-shadow.