=============================================================================
Software Information
    Document Software:  XMB Version 1.9.5 SP1
    Author: The XMBGroup
    Reference: http://xmbforum.com

Hack/Modification Information
    Branch Title Users Viewing Page Advanced
    Version: 2.0
    Build ID: 4462-RF3/200801222109

Document Information
    Author: Train (Michael Fraker) 1.9.8   1.0
    Contributors: Nick 1.9.8   1.0
                         JDaniels 1.9.8   1.0
    Original Code: John Briggs
    1.9.5 Compatibility: WormHole @ XMB Garage
    Referral URL: http://svn.otakuscion.com
    Last Updated: February 13, 2009 at 1304 PM EDT

What Does this modification do?
    This modification adds a line on your forum which allows you to see who's currently viewing the page you are on.
    This modification allows you to limit how many users show in this line.
    This modification allows you to set whether or not to show user rank icons.
    This modification shows the numerical value of users and guests viewing a page.

=============================================================================
Step 1: Insert RAW SQL
=============================================================================

Go to your admin panel at this time, and click "Insert RAW SQL". You will have an option to browse and upload 
SQL, please find the SQL.txt file which was included with this zip folder in the Docs folder and select it.

You may also copy and paste the contents of the sql.txt file into the upgrade field, whichever you prefer, click submit 
to continue.

=============================================================================
Step 2: Open header.php
=============================================================================
=============================================================================
Find
=============================================================================

// If the board is offline, display an appropriate message

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

// Users Viewing Page Advanced Mod Begin
if ($SETTINGS['viewusers'] == 'on') {
    require ROOT.'include/uvp.inc.php';
}
// Users Viewing Page Advanced Mod End

=============================================================================
Step 3: Open cp.php
=============================================================================
=============================================================================
Find
=============================================================================

        $spacecatson = $spacecatsoff = '';
        if ($SETTINGS['space_cats'] == "on") {
            $spacecatson = $selHTML;
        } else {
            $spacecatsoff = $selHTML;
        }

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

        // Users Viewing Page Advanced Mod Begin
        $viewuserson = $viewusersoff = '';
        switch ($SETTINGS['viewusers'] == 'on') {
            case 'on':
                $viewuserson = $selHTML;
                break;
            default:
                $viewusersoff = $selHTML;
                break;
        }
        
        $showsupadminon = $showsupadminoff = '';
        switch ($SETTINGS['showsupadmin'] == 'on') {
            case 'on':
                $showsupadminon = $selHTML;
                break;
            default:
                $showsupadminoff = $selHTML;
                break;
        }
        
        $viewiconson = $viewiconsoff = '';
        switch ($SETTINGS['viewicons'] == 'on') {
            case 'on':
                $viewiconson = $selHTML;
                break;
            default:
                $viewiconsoff = $selHTML;
                break;
        }
        // Users Viewing Page Advanced Mod End

=============================================================================
Find
=============================================================================

        printsetting1($lang['reportpoststatus'], 'reportpostnew', $reportposton, $reportpostoff);

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

        // Users Viewing Page Advanced Mod Begin
        printsetting1($lang['viewusers'], 'viewusersnew', $viewuserson, $viewusersoff);
        printsetting1($lang['showsupadmin'], 'showsupadminnew', $showsupadminon, $showsupadminoff);
        printsetting1($lang['viewicons'], 'viewiconsnew', $viewiconson, $viewiconsoff);
        printsetting2($lang['viewtally'], 'viewtallynew', ((int)$SETTINGS['viewtally']), 4);
        // Users Viewing Page Advanced Mod End

=============================================================================
Find
=============================================================================

        $resetSigNew = ($resetSigNew == 'on') ? 'on' : 'off';

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

        // Users Viewing Page Advanced Mod Begin
        $viewusersnew = ($viewusersnew == 'on') ? 'on' : 'off';
        $showsupadminnew = ($showsupadminnew == 'on') ? 'on' : 'off';
        $viewiconsnew = ($viewiconsnew == 'on') ? 'on' : 'off';
        $viewtallynew = (int) $viewtallynew;
        // Users Viewing Page Advanced Mod End

=============================================================================
Find
=============================================================================

$db->query("UPDATE $table_settings SET langfile='$langfilenew',

=============================================================================
Find Code At End Of Statement ");
=============================================================================

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

, viewusers='$viewusersnew', showsupadmin='$showsupadminnew', viewicons='$viewiconsnew', viewtally='$viewtallynew'");

=============================================================================
Step 4: Open English.lang.php
=============================================================================
=============================================================================
Find
=============================================================================

?>

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

// Users Viewing Page Advanced Mod Begin
$lang['viewusers'] = "Users Viewing Page Status:";
$lang['usersinforum'] =	" are viewing this page";
$lang['showsupadmin'] = "Show Super Admins on Users Viewing?:";
$lang['viewicons'] = "Show Icons in Users Viewing:";
$lang['viewtally'] = "How many users should be displayed in users viewing?:";
// Users Viewing Page Advanced Mod End

=============================================================================
Note Before Continuing
=============================================================================

Save and upload these affected files at this time. Once you are done, go to your forums, and then to the administration 
panel. From there select templates and follow the instructions below.

Please also upload the included uvp.inc.php file, located in the Contents folder, to your forum /include/ folder.

Also, if you want to use icons, simply upload the included image files, located in the Contents folder, to all your theme 
folders. Feel free to use your own! Just remember, they will fail to display if you decide to turn that status on and they 
aren't in your theme folder(s).

=============================================================================
Step 5: Find and Open header template
=============================================================================
=============================================================================
Find
=============================================================================

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

<br />

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

$showcurrentusr

=============================================================================
INSTALLATION COMPLETE

The installation of this modification is now complete. You can modify the settings in your admin cp. Enjoy!
=============================================================================