Skip to:
Content
Pages
Categories
Search
Top
Bottom

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?

Viewing 1 replies (of 1 total)
  • Oh sorry, the Code didn’t show up. Here another try.

    How do I have to change the following line
    `

    `
    in order to get the DATE instread of “active 30 seconds ago”.

    It finally should look like this:

    Carmenca
    active 30. Janunary 2012

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.