============================================================================================================================
Modification Name: Advanced IP Logging

Version: 1.0

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.5

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

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

License Note: This modification is released under the GPL License v3. 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

Author Note:
You downloaded this hack from XMBGarage.com, the best source for XMB related downloads.
Please visit http://www.xmbgarage.com/ for support.
============================================================================================================================
=======
Step 1:
=======
====================================
Go To Administration Panel --> Insert Raw SQL
====================================

Upload provided file named "SQL.txt" and "Submit Changes":

============================================================================================================================
=======
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 $table_members SET iplog='$newiplog' WHERE uid = '$self[uid]'");
    }
    // Advanced IP Logging Mod End

============================================================================================================================
=======
Step 3:
=======
=================
Edit File: member.php
=================
==========
Find Code:
==========

) VALUES ('', '$username',

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

, iplog) VALUES ('', '$username',

=====================
Find Code (On Same Line):
=====================
)");

================
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="http://www.samspade.org/t/ipwhois?a=' . $ip . '" target="_blank">' . $ip . '</a>';
        $comma = ', ';
    }
    // Advanced IP Logging Mod End

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

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

============================================================================================================================
=======
Step 6:
=======
===============================
Go To Administration Panel --> Templates
===============================
===========================
Edit Template: admintool_editprofile
===========================
==========
Find Code:
==========

<a href="http://www.samspade.org/t/ipwhois?a=$member[regip]" target="_blank">$member[regip]</a>

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

<br />$lang[iplogs] $iploginfo

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