<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman, new york, times, serif;font-size:12pt">No luck with that. Time code shown in database = 1171293946 timecode called by using the following<br><br>global $user;<br>$account = user_load(array((is_numeric($user->uid) ? 'uid' : 'name') => $user->uid, 'status' => 1)); <br>print $account-access;<br><br>
1171294179<br><br>You see the trick here is that to see the printed time you have to login. Since there is no last login stored the $object->access pulls thle only thing available.<br><br>What I have done in my module is store the time in another field so I have lastaccess and newaccess. Newacess is being constanly updated by the user object. But lastaccess only accepts a value from newaccess. When newaccess is updated the old value goes to lastaccess which is what I want to be able to use.<br><br>I could not find anything in the present core that does this.<br><div> </div><div> <div><font face="Arial" size="2">Carl Mc Dade<br>____________________________<br>Web Developer<br><br></font></div><div><font face="Arial" size="2"><br> </font></div></div><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;">----- Original Message
----<br>From: John VanDyk <jvandyk@iastate.edu><br>To: development@drupal.org<br>Sent: Monday, February 12, 2007 3:55:48 PM<br>Subject: Re: [development] No last access?<br><br><div><a target="_blank" href="http://drupal.org/node/91786">http://drupal.org/node/91786</a> "user_load() clarification"<br><br>>I can imagine the the global user might not have <br>>the info in it... but if you do <br>>user_load(array('uid' => $user->uid)); // <-- <br>>$user is global user, you might get a hold of <br>>it. Just shooting from the hip.<br>><br>>Moshe Weitzman wrote:<br>>>Carl Mc Dade wrote:<br>>>>Well, I spent sunday evening being sick and <br>>>>looking over last access functionality <br>>>>historically as per Bérs advice. I looked back <br>>>>to version 4.4 to 4.7.4. a found surprisingly <br>>>>that Drupal has never really had a last access <br>>>>functionality. It has had
calculation code to <br>>>>gather such information but nothing <br>>>>definative. Strangely enough there has not <br>>>>been too much call for this information so no <br>>>>one has noticed.<br>>><br>>>This is all nonsense. The user admin page shows <br>>>you last access for each user. And that number <br>>>is accurate, so we must be collecting that info <br>>>somewhere. Furthermore, access is easily <br>>>available for all modules in the standard $user <br>>>object.<br>>><br>>>Fire up your debugger and you will see the <br>>>writing of this infomation in sess_write().<br>>><br>><br>><br>>--<br>>* * * * *<br>>Lullabot's First Ever Advanced Workshops Are Here!<br>>Drupal API & Module Building - Advanced Drupal Themeing<br>>April 9th-13th - Providence, RI<br>>Early Bird Discounts Available Now<br>><a target="_blank"
href="http://www.lullabot.com/training">http://www.lullabot.com/training</a><br>>* * * * *<br><br></div></div><br></div></div><br>
<hr size=1>Now that's room service! <a href="http://travel.yahoo.com/hotelsearchpage;_ylc=X3oDMTFtaTIzNXVjBF9TAzk3NDA3NTg5BF9zAzI3MTk0ODEEcG9zAzIEc2VjA21haWx0YWdsaW5lBHNsawNxMS0wNw--
">Choose from over 150,000 hotels <br>in 45,000 destinations on Yahoo! Travel</a> to find your fit.</body></html>