Put simply (SQL Server english query style) I need to get
"how long it has been since the user last visited"
"the time/date of the users last visit"
made available to a module when the user logs in.
Carl Mc Dade
____________________________
Web Developer
----- Original Message ----
From: AjK <drupal(a)f2s.com>
To: development(a)drupal.org
Sent: Monday, February 12, 2007 6:10:54 PM
Subject: Re: [development] No last access?
Carl,
> Nope, That is updated first so their is no way of pulling
> the old time code before the newer on sets. This is the
> same problem as the access object. As matter of fact the
> login ia updated a split second before the access time.
>
> access = 1171296985
> login= 1171296984
OK, let's go back to basics.... here's your question again:
> Is there no longer a last access functionality?
> using the global user and calling $user->access
> gives the value after the database has been updated.
> Not the value in the database at the time of login.
> Ex. the value in the database table is 0000002.
> You will not get this value but the value 0000003
> which is the time of the latest access.
The ->login is updated when a user logs in. It's updated
just once at the login time. So I'm reading your question
again and, if it's not ->login that you want you'll have
to rephrase your question to make sense. I read your
question as "I want the time the user actually logged in".
Also, you might avoid the "confrontational" type responses
by wording your question in a non-confrontational manner.
"Is there no longer a last access functionality?" sounds
like your accusing some Drupal Ninja Squirrel of stealing
some of your nuts.
How about posting:-
"I want to find the time for this particular event... blah blah"
Basically, what I want to know is what do you mean by "last access
functionality"?
We have
->login which is timestamp at login
->access which is timestamp at last browser hit
You want
->something
Define something.
One point; "Nope, That is updated first so their is no way of pulling the
old time code before the newer on sets". Erm, just how far back do you want
to go? You are experimenting on global $user and so I assume you logged in
to test, so I would expect recent values for ->login and ->access
Imagine you are using user foo (eg uid = 1234). If you load that user object
what you appear to asking for here is "when did that user login the time
before the last login?". That's rather odd functionality to expect of any
system except those that keep a record of every login time, forever.
->login is "the last time the user logged in" not "the last time the user
logged in before last".
So, it seems your question and your responses to date have been a little
unclear.
regards,
--Andy
(ps, I'm trying to help ;)
____________________________________________________________________________________
Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121
Nope, That is updated first so their is no way of pulling the old time code before the newer on sets. This is the same problem as the access object. As matter of fact the login ia updated a split second before the access time.
access = 1171296985
login= 1171296984
Carl Mc Dade
____________________________
Web Developer
----- Original Message ----
From: AjK <drupal(a)f2s.com>
To: development(a)drupal.org
Sent: Monday, February 12, 2007 4:57:43 PM
Subject: Re: [development] No last access?
> Is there no longer a last access functionality?
> using the global user and calling $user->access
> gives the value after the database has been updated.
> Not the value in the database at the time of login.
> Ex. the value in the database table is 0000002.
> You will not get this value but the value 0000003
> which is the time of the latest access.
The above was your original question.....
> No luck with that. Time code shown in
> database = 1171293946 timecode called by
> using the following
<snip>
> print $account-access;
> 1171294179
Erm, am I missing something here or should you not be doing:-
print $account->login;
"login" holds the timestamp of the last login, "access" holds the timestamp
of the last browser hit for the user.
This is from user.module:-
// Update the user table timestamp noting user has logged in.
db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(),
$user->uid);
and this is from session.inc:-
db_query("UPDATE {users} SET access = %d WHERE uid = %d", time(),
$user->uid);
regards,
--Andy
____________________________________________________________________________________
TV dinner still cooling?
Check out "Tonight's Picks" on Yahoo! TV.
http://tv.yahoo.com/
Small question , we have commited googleajaxsearch module for drupal-5, i
have created branch Drupal-5 and commited the files. Anyway with drupal 4-7
it tooks like a day to compress and publish the tarbal, am I skipping
something because its 4th day and there is no compressed package visable.
Thanks for the feedback.
--
Kinest regards,
Maciej Perlinski
http://www.meant4.pl Web Studio
http://www.meant4.com Hosting Solutions
mobile +48 600 8 9999 1
office +48 22 845 39 29
That sounds like the most logical explaination so far. Trying it now.
Carl Mc Dade
____________________________
Web Developer
----- Original Message ----
From: AjK <drupal(a)f2s.com>
To: development(a)drupal.org
Sent: Monday, February 12, 2007 4:57:43 PM
Subject: Re: [development] No last access?
> Is there no longer a last access functionality?
> using the global user and calling $user->access
> gives the value after the database has been updated.
> Not the value in the database at the time of login.
> Ex. the value in the database table is 0000002.
> You will not get this value but the value 0000003
> which is the time of the latest access.
The above was your original question.....
> No luck with that. Time code shown in
> database = 1171293946 timecode called by
> using the following
<snip>
> print $account-access;
> 1171294179
Erm, am I missing something here or should you not be doing:-
print $account->login;
"login" holds the timestamp of the last login, "access" holds the timestamp
of the last browser hit for the user.
This is from user.module:-
// Update the user table timestamp noting user has logged in.
db_query("UPDATE {users} SET login = %d WHERE uid = %d", time(),
$user->uid);
and this is from session.inc:-
db_query("UPDATE {users} SET access = %d WHERE uid = %d", time(),
$user->uid);
regards,
--Andy
____________________________________________________________________________________
The fish are biting.
Get more visitors on your site using Yahoo! Search Marketing.
http://searchmarketing.yahoo.com/arp/sponsoredsearch_v2.php
Dear, explicatives deleted (Karoly Negyesi)
Don't step on my thread with your venemous attitude. If you can't help or have anything nice to say then go back to sleep. I asked a simple question in the right area. If you want to go at me then you are welcome to send as much off list mail as you like. Don't use this list as your public soap box.
Carl Mc Dade
____________________________
Web Developer
----- Original Message ----
From: Karoly Negyesi <karoly(a)negyesi.net>
To: development(a)drupal.org
Sent: Sunday, February 11, 2007 10:13:12 AM
Subject: Re: [development] No last access?
> Is there no longer a last access functionality? using the global user and
calling $user->access gives the value after the database has been
updated. Not the value in the database at the time of login. Ex. the
value in the database table is 0000002. You will not get this value but
the value 0000003 which is the time of the latest access.
Carl Mc Dade
Dear Mr. Mc Dade,
Thanks for filing a detailed report -- which included the used Drupal version, whether the user is anonymous or not and all other details that you might find relevant -- in the issue queue as it's proper. Of course, none the less can expected from a long time Drupal contributor whose contributions include one of the most heated threads on drupal.org and some extremely clever use of drupal.org's high Google page rank through the user profile.
Kind regards,
Karoly Negyesi
____________________________________________________________________________________
Expecting? Get great news right away with email Auto-Check.
Try the Yahoo! Mail Beta.
http://advision.webevents.yahoo.com/mailbeta/newmail_tools.html