Modification Title: Most Users Online v1.0

Modification Author: John Briggs & Jonathon

Modification Description:
This modification will provide a text output of the time, date and total visits ever on the index page.

Supported Version: XMB 1.9.8 Engage Final SP3

Updated for 1.9.8 by: WormHole @ XMB Garage

Installation Note: Before adding this modification to your forum you should back up all files related to this modification.

License Note: This modification is released under the GPL License. A copy has been provided with this software package.

Author Note:
For security purposes, Please Check: http://www.xmbgarage.com for the latest version of this modification.
Downloading this modification from other sites could cause malicious code to enter into your XMB Forum software.
As such, xmbgarage.com will not offer support for mods not offered at our site.

=============================================================================================================================
NOTE: If you are using the Index Stats bar Modification then do not install this hack as it is incorporated in the Index Stats Bar code.
=============================================================================================================================
=======
Step 1:
=======

=============================
Go To Admin Panel -> Insert Raw SQL
=============================

Upload provided file named "SQL.txt" & click "Submit Changes" button.

==============================================================================================================================
=======
Step 2:
=======

=======================
Edit File: lang/English.lang.php
=======================

================
Add To End Of File:
================

// Most Users Online Mod Begin
$lang['Most_Users'] = "Most users online ever was";
$lang['Most_On'] = "on";
$lang['Most_At'] = "at";
// Most Users Online Mod End

=============================================================================================================================
=======
Step 3:
=======

===============
Edit File: index.php
===============

==========
Find Code:
==========

        eval($lang['evalindexstats']);

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

    // Most Users Online Mod Begin
    $sql = $db->query("SELECT * FROM $table_mostonline");
    $mostonline = $db->fetch_array($sql);
    $db->free_result($sql);

    $onlinetotal = '';
    if ($onlinetotal > $mostonline['mostonlinecount']){
        $db->query("UPDATE $table_mostonline SET mostonlinetime = '".time()."', mostonlinecount = '".$onlinetotal."'");
    }

    $mostdate = gmdate($dateformat, $mostonline['mostonlinetime'] + ($timeoffset * 3600) + ($addtime * 3600));
    $mosttime = gmdate($timecode, $mostonline['mostonlinetime'] + ($timeoffset * 3600) + ($addtime * 3600));

    $mosttext = ''.$lang['Most_Users'].' <strong>'.$mostonline['mostonlinecount'].'</strong> '.$lang['Most_On'].' <strong>'.$mostdate.'</strong> '.$lang['Most_At'].' <strong>'.$mosttime.'</strong>.';
    // Most Users Online Mod End

=============================================================================================================================
=======
Step 4:
=======

=====================
Edit File: header.php
=====================

==========
Find Code:
==========

    'members',

==================
Add Code Below:
==================

    'mostonline',

=============================================================================================================================
=======
Step 5:
=======

==================================
Go to admin panel -> templates -> index_stats
==================================

==========
Find Code:
==========

$memhtml

================
Replace Code With:
================

$memhtml<br />$mosttext

=============================================================================================================================