Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Forum Age
#1
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".
Reply
#2
i watched this on your forum Toungue is nice
[Image: banner468x60.jpg]
------
[Image: bluelogo2.gif]
Reply
#3
I'll use it. Wink
[Image: destroyerjf8.jpg]

Give us your feedback about MyBB in this thread and become listed on the MyBB website.
Reply
#4
Make it an plug-in with options to where to put it Wink
Reply
#5
I put it whole at the bottom of my forum. I'm not good in adding $ stuff. Toungue
http://www.chat2b.be/forum
[Image: destroyerjf8.jpg]

Give us your feedback about MyBB in this thread and become listed on the MyBB website.
Reply
#6
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?
Reply
#7
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...
Reply
#8
What about the shop mod? Toungue
[Image: destroyerjf8.jpg]

Give us your feedback about MyBB in this thread and become listed on the MyBB website.
Reply
#9
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
Reply
#10
But when will he be back?
[Image: destroyerjf8.jpg]

Give us your feedback about MyBB in this thread and become listed on the MyBB website.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)