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.
Pages: 1 2 3 4
neophyte mentioned this in the "Suggestions" forum, so I made a small mod for it.

Basically it calculates how old your forum is and outputs it as a variable in a template.

Open global.php

FIND:
$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);

Upload modified global.php

You can now include the variable $forumage in any template.

This will output in the form "x Years, x Months, x Weeks, x Days, x Hours, x Minutes, x Seconds".
i watched this on your forum Toungue is nice
I'll use it. Wink
Make it an plug-in with options to where to put it Wink
I put it whole at the bottom of my forum. I'm not good in adding $ stuff. Toungue
http://www.chat2b.be/forum
I can't even get that page, although you added the code into general.php? and added $forumage into your template? and is there even an problem you are refering to or?
CraKteR Wrote:Make it an plug-in with options to where to put it Wink

I'm gonna turn all both my mods into plugins once my exams are over, and then develop a load of cash mod appliances (people keep telling me they are getting bored of the War Game...
What about the shop mod? Toungue
Well Massacre was in the middle of that mod before he got called out to Iraq, so I'm really not sure what's happening. He said he'd got quite far with it, so I guess nobody is gonna try and make it whilst he's away. You're just gonna have to wait Toungue
But when will he be back?
Pages: 1 2 3 4