MyBB Community Forums

Full Version: Forum Age
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I think it might be nice to have an optional checkbox for the admin that places a line of text in the header or footer, saying: "This forum is XYZ years, XYZ days, and XYZ hours old." I don't want to get into minutes but down to hours would be kinda cool.
This can be easily done with a small modification. Open up global.php and find the line:
$datenow = mydate($mybb->settings['dateformat'], time(), '', false);
$timenow = mydate($mybb->settings['timeformat'], time());

AFTER ADD:
//Forum Age
$age_query = $db->query("SELECT regdate FROM ".TABLE_PREFIX."users ORDER BY regdate LIMIT 1");
$age_result = $db->fetch_array($age_query);
$age = time() - $age_result['regdate'];
$forumage = nice_time($age);

Now simply upload the changed global.php, and add "$forumage" anywhere in a template.

Check it out on my forum (http://www.drpoodle.com/forums). The line is at the bottom (in the footer). I just added "The forum is $forumage old" to the footer template.
Cool, thanx