Modification Name: Forum Uptime v1.0

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

Compatibility: XMB 1.9.8 SP3

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.

============================================================================================================================
=======
Step 1:
=======
================
Edit File: header.php
================
==========
Find Code:
==========

// Checks for the possibility to register

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

    // Begin Forum Uptime Hack
    $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 = "<strong>$bbname $lang[up1]: $futyeardisplay $futmonthdisplay $futdaydisplay $futhourdisplay $futminutedisplay $lang[up2] $futseconddisplay</strong></font>";
    // End Forum Uptime Hack

============================================================================================================================
=======
Step 2:
=======
=======================
Edit File: lang/English.lang.php
=======================
=======================
Add 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:
=======
====================
Edit Template: index_stats
====================
==========
Find Code:
==========

</table>
</td>
</tr>
</table>

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

<tr class="category">
<td align="left" colspan="2"><font color="$THEME[cattext]">$futdisplay</font></td>
</tr>

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