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 1 year 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 1 year 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 1 year ago #
  4. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 884

    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 1 year 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 1 year 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 1 year ago #
  7. _ck_
    _ck_

    senior admin
    Joined: Jul '06
    Posts: 884

    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 1 year 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:
39 users online from in the past 30 minutes. 14 bots 24 guests 1 members: mccawphoto
197 views today 7,784 yesterday 14,010 peak. Most at once 39 today 63 yesterday 131 peak. Visited today: mccawphoto
2,240 posts in 380 topics over 63 months by 425 of 1,992 members. Latest: shairah27, Augustine01, MichaelGomez