DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • July 18, 2019, 10:54:41 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Resource Pages

Pages: [1]   Go Down
Author Topic: Time between two log ons  (Read 2364 times)
0 Members and 1 Guest are viewing this topic.
« on: May 30, 2005, 10:36:12 AM »

I am writing a module that needs to check (upon logging in) when was that user logged in for the last time, to calculate the time difference between the two sessions.

Is there a modulehook that happens before modifying $session['user]['laston'] for the first time after logging in?

If not, do you have any suggestions how should I execute this calculation?

The calculation I had in mind looks like this:

iMod God
SVN Users
Mod God
Offline Offline

Posts: 3458

If ya didn't get it by now... you're hopeless...

View Profile WWW
« Reply #1 on: May 30, 2005, 10:45:39 AM »

$session['laston']=date("Y-m-d H:i:s");
//some misc code
$session['user']['laston'] = date("Y-m-d H:i:s");

There are two hooks that you can use:
  • player-login
  • player-logout
player-login occurs after the modification of the laston. But, you may still use the two different values for calculation. Just store it in a pref at player-logout, and then check it against the new laston at player-login... if different, then do your calculation.

Have fun.
« Last Edit: May 30, 2005, 10:46:55 AM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Pages: [1]   Go Up
Jump to:  

DragonPrime Notices
Version 1.1.2 is the current supported version and is available for download.

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
95 Guests, 1 User
Home Forums News Downloads Login Register Advanced Search