DeeEmm

Pragmatism in code

You can (fairly) easily record the userid along with the ip address by adding an extra field to the database table and modifying member.php

Here's how...

Add the following fields to the sys_ip_members_visits table in database

ALTER TABLE `sys_ip_members_visits` ADD `UserID` INT( 10 ) NOT NULL

ALTER TABLE `sys_ip_members_visits` ADD `UserName` VARCHAR( 30 ) NOT NULL

 

Then search for following line in member.php

$sInsertSQL = "INSERT INTO `sys_ip_members_visits` SET `From`='{$sCurLongIP}', `DateTime`=NOW()";

Replace it with

$aMemberInfo = getProfileInfoDirect($member['ID']);
$sUserName = $aMemberInfo['NickName'];

$sInsertSQL = "INSERT INTO `sys_ip_members_visits` SET `From`='{$sCurLongIP}', `DateTime`=NOW(), `UserID`='{$sUserID}', `UserName`='{$sUserName}'";


Now edit inc/classes/BxDolAdminIPBlocklist.php

Find

<tr>
<td>{$sFromC}</td>
<td>{$sDatatimeC}</td>
</tr>

Change it to

<tr>
<td>ID</td>
<td>UserName</td>
<td>{$sFromC}</td>
<td>{$sDatatimeC}</td>
</tr>


Find

$sLastDT = $aIPList['DateTime'];


Add After

$sUserID = $aIPList['UserID'];
$sUserName = $aIPList['UserName'];


Find

$sTableRes .= "<tr><td>{$sFrom}</td><td>{$sLastDT}</td></tr>";

Replace it with

$sTableRes .= "<tr><td>{$sUserID}</td><td>{$sUserName}</td><td>{$sFrom}</td><td>{$sLastDT}</td></tr>";

All Done!!

Now the userid will be recorded with the ip address and displayed in the table on the admin page.