Search

bbPress Showcase » Plugins by _ck_

  1. gerikg
    User has not uploaded an avatar

    member
    Joined: May '10
    Posts: 10

    offline

    I'm writing "<?php get_forum_time() ?;> ago" but if there is no post it just prints ago. How do I write something so it won't print if it's blank?

    Posted 2 years ago #
  2. ashfame
    ashfame

    junior member
    Joined: Jul '09
    Posts: 8

    offline

    <?php echo get_forum_time() ?;> should work

    Homepage - http://www.ashfame.com | Blog - http://blog.ashfame.com
    (Contact me for bbPress & WordPress work)
    Posted 2 years ago #
  3. gerikg
    User has not uploaded an avatar

    member
    Joined: May '10
    Posts: 10

    offline

    "<?php forum_time() ?;> ago" = "TIME ago"

    but if there is NO post in a forum = "ago"

    how do I write = if forum_time() is NULL print ""

    Posted 2 years ago #
  4. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Ah I didn't anticipate empty forums, which sounds kinda strange actually.

    You could do this

    <?php $time=get_forum_time(); if ($time) {echo "$time ago";} ?>

    This is a demo of the bbPress Signatures plugin!
    If you use my plugins, please considering donating to help continue their development.
    Posted 2 years ago #
  5. gerikg
    User has not uploaded an avatar

    member
    Joined: May '10
    Posts: 10

    offline

    When you're starting out new most forums are empty. Thank you, I'll try it.

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

    member
    Joined: May '10
    Posts: 10

    offline

    it didn't work

    All the blank ones are now saying: 40 years ago

    Posted 2 years ago #
  7. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 908

    offline

    Until I get a chance to fix it, just use

    if ($time && $time!="40 years")

    Either that or put a topic in the empty forum.

    Posted 2 years ago #

RSS feed for this topic

Post a reply to “[forum-last-poster] plugin if get_forum_time() is null”

You must log in to post.

keep _ck_ coding >> donate $5 <<     Theme Switcher:
32 users online from in the past 30 minutes. 15 bots 17 guests
7,067 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