Search

bbPress Showcase » Plugins by _ck_

  1. ilmanakbar
    User has not uploaded an avatar

    new member
    Joined: Oct '09
    Posts: 1

    offline

    I'm sorry, it's cross-posted from the bbPress support forum.

    _ck_, I want to display the exact time/date of the last posts rather than "1 day ago" or "2 months ago".. where's the part of your code should I change?

    I've successfully edited the Freshness on "Latest Discussion" with the exact time/date using this code

    <?php echo(topic_time('j M Y')); ?><?php echo(topic_time('H:i')); ?>

    I tried using the same code to replace forum_time() but it didn't work obviously..

    thanks for the code..

    Posted 2 years ago #
  2. Kamil
    User has not uploaded an avatar

    new member
    Joined: May '09
    Posts: 3

    offline

    Hi _ck_,

    I am trying also to display exact time of the last posts using forum_time() function but it doesn't works for me also
    Can you help us plz...?

    Posted 2 years ago #
  3. albertrandom
    User has not uploaded an avatar

    new member
    Joined: May '11
    Posts: 3

    offline

    Has anyone come up with an answer for this?

    I've been trying for quite some time. The Forum Last Poster plugin works well for me to get freshness, but I can't seem to get the date. The following code only gets me a static date of Wed Dec 31, 1969 5:00 pm:

    <?php echo date("D M j, Y g:i a", bb_offset_time(strtotime($bb_forum->forum_time))); ?>

    Thanks

    Posted 1 year ago #
  4. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Forum-last-poster uses <?php echo get_forum_time(); ?>

    which is

    get_topic_time(forum_last_topic_id($id))

    get_topic_time takes the topic's mysql date and converts into a "since format"

    so if you don't want that, you have to do it the long way

    <?php
    $t1=get_topic(forum_last_topic_id());
    echo date("D M j, Y g:i a", bb_offset_time(strtotime($t1->topic_time)));
    ?>
    Posted 1 year ago #
  5. albertrandom
    User has not uploaded an avatar

    new member
    Joined: May '11
    Posts: 3

    offline

    Thanks. That worked well. Any idea why the first forum row, though, would give the wrong time/date (three hours ahead) while all other forum rows work perfectly?

    The very same thing happens on the posts page. I've changed the freshness to show the time/date. The time/date of the first post is wrong (three hours ahead), while all subsequent post times are correct.

    I would love to find a solution if possible. Thanks.

    Posted 1 year ago #
  6. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Sounds like something is messing with the time, if the post always changed but every last post is always three hours ahead. Very strange.

    Posted 1 year ago #
  7. albertrandom
    User has not uploaded an avatar

    new member
    Joined: May '11
    Posts: 3

    offline

    Agreed. Very strange.

    It is just the time of the very first post on the post page, and just the last post time of the very first forum on the forums page. All other posts/forums below them reflect the correct times. And if I delete the first post/forum, the second post/forum (which now becomes the first), reverts to the incorrect time.

    On the topics page though, all the last post times for all the topics (even the first) are reflected correctly.

    Thanks for the help. If I find the issue, I will post it in case it's helpful for anyone else.

    Posted 1 year ago #
  8. engin1984
    engin1984

    new member
    Joined: Jan '11
    Posts: 3

    offline

    <?php topic_start_time('datetime'); ?>
    and
    <?php topic_time(array('format'=>'d F Y - H:i')); ?>

    Posted 4 months ago #

RSS feed for this topic

Post a reply to “Exact Time/Date in "Forum Last Poster"”

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
37 users online from in the past 30 minutes. 17 bots 20 guests
7,037 views today 8,426 yesterday 16,043 peak. Most at once 50 today 62 yesterday 131 peak. Visited today: Amylawrence, guava, JeffreyCasivant, wigbuy123, gdfddfs, nandao, _ck_, summerfortun
2,288 posts in 394 topics over 66 months by 430 of 2,167 members. Latest: watchessaleus, wigbuy123, JeffreyCasivant