Last Login Date on Members Directory?
-
Hello there,
First of all, I must admit I’m new to all this. Last week I installed WP and BP and it’s running perfectly. I just wonder if it’s possible to show the last login date instead of ‘active since’ () ?I searched for this for almost the whole week, but all I could find was the script by David Cowgill which only displays the login date of the current user.
[ function appthemes_last_login($login) {
global $user_ID;
$user = get_userdatabylogin($login);
update_usermeta($user->ID, ‘last_login’, current_time(‘mysql’));
}
add_action(‘wp_login’,’appthemes_last_login’);function appthemes_get_last_login($user_id) {
$last_login = get_user_meta($user_id, ‘last_login’, true);
$date_format = get_option(‘date_format’) . ‘ ‘ . get_option(‘time_format’);
$the_last_login = mysql2date($date_format, $last_login, false);
echo $the_last_login;
}<?php
global $userdata;
get_currentuserinfo();
?>ID); ?>
]Is there any way to get the last login date of each member?
- The topic ‘Last Login Date on Members Directory?’ is closed to new replies.