Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Group Forum display time

  • Avatar of omgbud
    omgbud
    Participant

    @omgbud

    Hi, How to display the topic post start date and time instead of since how many hours and minutes ago?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of danbpfr
    danbpfr
    Participant

    @chouf1

    hi @omgbud,

    if BP 1.6.x, you can add this to your theme’s functions.php
    This will change the date format of each group forum topic

    `function my_topic_date_ouput () {`

    global $forum_template;
    echo date (‘M d, Y  ‘, strtotime($forum_template->topic->topic_time));

    }
    add_filter( ‘bp_get_the_topic_post_time_since’, ‘my_topic_date_ouput’ );

    For for changing the freshness date/time, use this one

    <code>function my_topic_freshness_ouput () {
    global $forum_template;
    echo date (‘d/m/Y H:i  ‘, strtotime($forum_template->topic->topic_time));
    }
    add_filter( ‘bp_get_the_topic_time_since_last_post’, ‘my_topic_freshness_ouput’ ); </code>

    Take care with quotes (must be single quotes)  when copy/pasting from here

     

    Avatar of omgbud
    omgbud
    Participant

    @omgbud

    Hey Chouf1,

    thank you for replying, this code works partially, it only get the LAST topic replied post date and time and display all the same date and time throughout the rest of the replies for that topic. Any helps? Thanks again.

    `function my_topic_date_ouput () {

    global $forum_template;
    echo date (‘M d, Y, g:i a ‘, strtotime($forum_template->topic->topic_time));

    }
    add_filter( ‘bp_get_the_topic_post_time_since’, ‘my_topic_date_ouput’ );`

    Avatar of omgbud
    omgbud
    Participant

    @omgbud

    Oh I solved this with, modified the topic.php. Don’t mind editing the core files.:

    `
    echo date (‘M d, Y, g:i a ‘, strtotime(bp_get_the_topic_post_time_since()));
    `

    Thanks for the help Chouf1!

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.