[support] how to get the list of new nodes since last login?

Haisam K. Ido haisam at ido.org
Thu May 3 17:13:18 UTC 2007


Jason:

This does it for finding out the last time a uid closed their session.

SELECT uid,timestamp FROM `watchdog` where message like 'Session closed 
for%'


Jason Flatt wrote:
> On Thursday May 3 2007 4:29 am, Haisam Ido wrote:
>   
>> Thanks  Nicolas.  But I don't think that would work because by the time
>> that query runs the 'login' field in the 'users' table would have been
>> updated with the latest 'login' time.  Is there another table that keeps
>> the history of user logins?  I know there must be one since users'
>> logins are logged.
>>
>>     
>
> You would probably have to create a custom module and use hook_user to get the 
> login time (from the &$user variable, with either the load, login or update 
> ops) before Drupal has actually logged in the user, and save it somewhere in 
> another database table/field, or using the variable_set/get() functions.
>
> http://api.drupal.org/api/5/function/hook_user
>
>
>   


More information about the support mailing list