Skip to:
Content
Pages
Categories
Search
Top
Bottom

Show User Registration Date

  • Hello bbP community,

    I’m looking for the syntax to display the User Registration Date, e.g. under the User Name. I’m not interested in post counts for my forum so this would be a nice replacement.

    Thanks

    Lars

Viewing 8 replies - 1 through 8 (of 8 total)
  • Hmm, still didn’t figure out the syntax for this. :(


    chrishajer
    Participant

    @chrishajer

    You didn’t mention what version you’re using.

    But, in my old version and in the latest trunk, bb-admin/admin-functions.php contains “bb_user_row” which returns the date the member registered: you can see it in the admin screen for managing users. I imagine duplicating or using that function would get you the the date of registration.

    And when viewing a member profile, the “Member Since” text appears there also, with a more nicely formatted date (no time.) If you look at how the date is displayed there I bet you could get it to display where you want.

    Hi chris and thank you for your suggestion.

    I looked into the function you mentioned in template_functions.php which would be around here:

    function bb_profile_data( $id = 0 ) {
    if ( !$user = bb_get_user( bb_get_user_id( $id ) ) )
    return;

    $reg_time = bb_gmtstrtotime( $user->user_registered );
    $profile_info_keys = get_profile_info_keys();
    echo "<dl id='userinfo'>n";
    echo "t<dt>" . __('Member Since') . "</dt>n";
    echo "t<dd>" . bb_datetime_format_i18n($reg_time, 'date') . ' (' . bb_since($reg_time) . ")</dd>n";

    The problem is that this functions gets the data from the currently logged in user, or so I would assume, given that it’s the data for that specific profile.

    But in order to display the registration date for each user in a topic I’d need to call the data for each user individually.


    perineo
    Participant

    @perineo

    Any idea in this one? I managed to put a flag of the user, but cant manage to show post count and user registration date, in loop-single-reply.

    Any suggestion?

    `
    $user = get_userdata( $user_id );
    $registerdate = $user->user_registered;
    echo date(“Y-m-d”, strtotime($registerdate));
    `

    You should be able to place the bbPress author ID where the $user_id is if you are using this in a loop.


    perineo
    Participant

    @perineo

    mmm 1970-01-01 šŸ™‚ Any clue?


    pawankumarr
    Participant

    @pawankumarr

    $user = get_userdata( $user_id );
    $registerdate = $user->user_registered;
    echo date(ā€œY-m-dā€, strtotime($registerdate));

    in this code please provide full code with bbpress user id

    there we can print actual date


    Robkk
    Moderator

    @robkk

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.
Skip to toolbar