Author Topic: MOD: Record Last Login Date of Member  (Read 1674 times)

videosforkids

  • V3 Beta Tester
  • Full Member
  • *
  • Posts: 279
MOD: Record Last Login Date of Member
« on: September 30, 2009, 11:23:20 AM »
Here is a quick mod that will record the last login date of your members.

Instructions:

  • Make a backup of your entire database and login.php
  • Open PHPmyAdmin and navigate to your member_profile table
  • Scroll down to the bottom of the list of fields and click to Add 1 field at the bottom
  • name this field last_login
  • Open login.php and look for this code
Code: [Select]
//account OK
///////////////////////

  • Below that insert the following code:
Code: [Select]
//record date of most recent login
$id = $_SESSION["user_id"];
$date = $config["date_format"];
$sql = "UPDATE member_profile SET last_login = '$date' WHERE user_id = $id";
@mysql_query($sql);
  • Save and upload login.php

That's it, now each time your members login it will update that field with the date of their most recent login.
« Last Edit: September 30, 2009, 02:31:53 PM by videosforkids »

Thiva7

  • Newbie
  • *
  • Posts: 11
Re: MOD: Record Last Login Date of Member
« Reply #1 on: September 03, 2010, 06:54:21 PM »
1) what i add in data base?? where is code for phpmyadmin?
2)where i can see last login of user?? where is code for siteadmin or some file to show us last login???