Name: Advanced IP Logging

Version: 1.0

Last modified: 06/07/2009 @ 09:00 (EDT)

Description: This modification will log every IP that a member uses.
                   This modification provides an option for admins to view the IP's that a member has used via the admin edit profile tool.

Compatibility: XMB v1.9.8 SP3

Tested On: XMB 1.9.8 SP3

Code Developed By: Adam Clarke (http://www.xmbservices.com)

Updated for 1.9.8 by: WormHole @ XMB Garage

MOD History: V1.0 (20/11/2005 @ 21:10) - Initial Release.

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

Note: Backup all affected files, templates & database's.

Affected Files (4): header.php, member.php, editprofile.php, English.lang.php

Affected Templates (1): admintool_editprofile

====================================================================================================
========
STEP 1:
========
===================================
Go To Administration Panel --> Insert Raw SQL
===================================
===================================================
Upload provided file named "SQL.txt" & click "Submit Changes" button.
===================================================
=====================================================================================================
========
STEP 2:
========
=================
Edit File: header.php
=================
==========
Find Code:
==========

    foreach($userrec as $key => $val) {
        $self[$key] = $val;
    }

===============
Add Code Below:
===============
        
    // Advanced IP Logging Mod Begin
    if (false === strpos($self['iplog'], $onlineip)) {
        $comma = '';
        if (!empty($self['iplog'])) {
            $comma = ', ';
        }
        $newiplog = $self['iplog'] . $comma . $onlineip;
        $db->query("UPDATE ".X_PREFIX."members SET iplog='$newiplog' WHERE uid = '$self[uid]'");
    }
    // Advanced IP Logging Mod End

====================================================================================================
========
STEP 3:
========
==================
Edit File: member.php
==================
=================
Find Code (2 Times):
=================

) VALUES ('$username',

=======================
Replace Code With (2 Times):
=======================

, iplog) VALUES ('$username',

===============================
Find Code (At End Of These Same Lines):
===============================

)");

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

, '$onlineip')");

====================================================================================================
========
STEP 4:
========
===================
Edit File: editprofile.php
===================
==========
Find Code:
==========

    eval('echo stripslashes("'.template('admintool_editprofile').'");');

===============
Add Code Above:
===============
    
    // Advanced IP Logging Mod Begin
    $iploginfo = $comma = '';
    $ips = explode(', ', $member['iplog']);
    foreach ($ips as $ip) {
        $iploginfo .= $comma . '<a href="network-tools.com/default.asp?prog=whois&host=' . $ip . '" target="_blank">' . $ip . '</a>';
        $comma = ', ';
    }
    // Advanced IP Logging Mod End

====================================================================================================
========
STEP 5:
========
=======================
Edit File: lang/English.lang.php
=======================
========================
Add To End Of File Above ?>
========================

// Advanced IP Logging Mod Begin
$lang['iplogs'] = "All Logged IP's:";
// Advanced IP Logging Mod End

====================================================================================================
========
STEP 6:
========
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<a href="http://www.nwtools.com/default.asp?prog=network&host=$member[regip]" target="_blank">$member[regip]</a>

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

<br />$lang[iplogs] $iploginfo

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