============================================================================================================================
Modification Name: Forum Uptime_v1.0

Description: This modification will allow you to display the length of time that your forum has been up and running.

Compatibility: XMB 1.9.5 SP1

Code Developed By: Adam Clarke (http://www.scriptdesign.co.uk)

Note:
This modification is based on the original forum uptime hack by Dogidog2001.
I have re-coded it as I could not get it to display the information correctly.

Backup all affected files, templates & databases.

License Note: This mod is released under the GPL License. A copy is provided with this software.
============================================================================================================================
=======
Step 1:
=======
=================
Edit File: header.php
=================
==========
Find Code:
==========

// Checks for the possibility to register

===============
Add Code Above:
===============

// Forum Uptime Mod Begin
$futsecond = $futminute = $futhour = $futday = $futmonth = $futyear = 0;

$query = $db->query("SELECT `regdate` FROM `$table_members` WHERE `uid` = '1'");
$fut = $db->fetch_array($query);
$futstart = $fut['regdate'];
$futnow = time() + ($timeoffset * 3600) + ($addtime * 3600);

$futsecond += (gmdate("s", $futnow) - gmdate("s", $futstart));
if ($futsecond < 0) {
    $futsecond += 60;
    --$futminute;
}
$futminute += (gmdate("i", $futnow) - gmdate("i", $futstart));
if ($futminute < 0) {
    $futminute += 60;
    --$futhour;
}
$futhour += (gmdate("H", $futnow) - gmdate("H", $futstart));
if ($futhour < 0) {
    $futhour += 24;
    --$futday;
}
$futday += (gmdate("d", $futnow) - gmdate("d", $futstart));
if ($futday < 0) {
    $futday += gmdate("t", $futstart);
    --$futmonth;
}
$futmonth += (gmdate("m", $futnow) - gmdate("m", $futstart));
if ($futmonth < 0) {
    $futmonth += 12;
    --$futyear;
}
$futyear += (gmdate("Y", $futnow) - gmdate("Y", $futstart));

if ($futyear == 1) {
    $futyeardisplay = "$futyear $lang[year], ";
} else {
    $futyeardisplay = "$futyear $lang[years], ";
}

if ($futmonth == 1) {
    $futmonthdisplay = "$futmonth $lang[month], ";
} else {
    $futmonthdisplay = "$futmonth $lang[months], ";
}
	
if ($futday == 1) {
    $futdaydisplay = "$futday $lang[day], ";
} else {
    $futdaydisplay = "$futday $lang[days], ";
}
	
if ($futhour == 1) {
    $futhourdisplay = "$futhour $lang[hour], ";
} else {
    $futhourdisplay = "$futhour $lang[hours], ";
}
	
if ($futminute == 1) {
    $futminutedisplay = "$futminute $lang[minute]";
} else {
    $futminutedisplay = "$futminute $lang[minutes]";
}
	
if ($futsecond == 1) {
    $futseconddisplay = "$futsecond $lang[second]";
} else {
    $futseconddisplay = "$futsecond $lang[seconds]";
}

$futdisplay = "<br />$bbname $lang[up1]: <strong>$futyeardisplay $futmonthdisplay $futdaydisplay $futhourdisplay $futminutedisplay $lang[up2] $futseconddisplay</strong></font>";
// Forum Uptime Mod End

============================================================================================================================
=======
Step 2:
=======
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above ?>
============================

// Forum Uptime Mod Begin
$lang['up1'] = "has been online for";
$lang['up2'] = "and";
$lang['year'] = "Year";
$lang['years'] = "Years";
$lang['month'] = "Month";
$lang['months'] = "Months";
$lang['day'] = "Day";
$lang['days'] = "Days";
$lang['hour'] = "Hour";
$lang['hours'] = "Hours";
$lang['minute'] = "Minute";
$lang['minutes'] = "Minutes";
$lang['second'] = "Second";
$lang['seconds'] = "Seconds";
// Forum Uptime Mod End

============================================================================================================================
=======
Step 3:
=======
===============================
Go To Administration Panel --> Templates
===============================
================
Edit Template: index
================
==========
Find Code:
==========

$memhtml

==============
Add Code After:
==============

$futdisplay

============================================================================================================================
Enjoy!