Topic: ip address record at login
Well I created this mod to record each IP when users log.
So here are the steps:
1) go to your mysql and execute this sql command:
ALTER TABLE `vld_members` ADD `ipaddresslogin` VARCHAR( 16 ) CHARACTER SET ucs2 COLLATE ucs2_general_ci NOT NULL DEFAULT '127.0.0.1'
2) edit includes/lib/lib.account_login.php
3) search for
if ($SESSION->auth) {
After if ($SESSION->auth) {
add:
// log ip connection MOD by Hacka
$iplogin= $_SERVER['REMOTE_ADDR'];
mysql_query("UPDATE vld_members SET ipaddresslogin='$iplogin' WHERE member_id=".$_SESSION['member_id']."");
4) edit includes/templates/members_edit.tpl
Search for:
<tr>
<td class="gridLabels2">
{lang:"members","referrer"}
BEFORE ADD:
<tr>
<td class="gridLabels1">
{lang:"members","iplogin"}</td>
<td class="gridValue1">
<!-- IF member_id -->
<a target="_blank" href="http://www.infosniper.net/index.php?ip_address={ipaddresslogin}&map_source=1&overview_map=1&lang=1&map_type=1&zoom_level=7">{ipaddresslogin}</a>
{country_flag}
<!-- IF ipaddress_banned -->
[ <a class="grid" href="#" onclick="javascript:confirmLink('{lang:"members","unbanip?"}', '{top.virtual_cp_path}index.php?m=members&p=unbanip&id={member_id}&s={ipaddresslogin}')">{lang:"members","unbanip"}</a> ]
<!-- ELSE -->
[ <a class="grid" href="#" onclick="javascript:confirmLink('{lang:"members","banip?"}', '{top.virtual_cp_path}index.php?m=members&p=banip&id={member_id}&s={ipaddresslogin}')">{lang:"members","banip"}</a> ]
<!-- ENDIF -->
[ <a class="grid" href="#" onclick="javascript:confirmLink('{lang:"members","spammer?"}', '{top.virtual_cp_path}index.php?m=members&p=spammer&id={member_id}&s={ipaddresslogin}')">{lang:"members","spammer"}</a> ]
<!-- ELSE -->
{ipaddresslogin}
<!-- ENDIF --></td>
</tr>
5) Edit your language file in includes/language/{YOUR LANGUAGE FOLDER}/lang.cp.members.php
search for
"unbanip" =>
BEFORE ADD:
"iplogin" =>
"logged-in IP",
6)edit includes/cp/cp.search.php
after
$TEMPLATE->assign("ipaddress", $ipaddress);add:
$TEMPLATE->assign("ipaddresslogin", $ipaddresslogin);search for
$ipaddress = isset($profile_obj['ipaddress']) ? $profile_obj['ipaddress'] : '127.0.0.1';after add
$ipaddresslogin = isset($profile_obj['ipaddresslogin']) ? $profile_obj['ipaddresslogin'] : '127.0.0.1';7) edit includes/cp/cp.search.php
if ($where == "all")
$sqlquery = "(username LIKE '%$what%' OR email LIKE '%$what%' OR ipaddress LIKE '%$what%')";change into
if ($where == "all")
$sqlquery = "(username LIKE '%$what%' OR email LIKE '%$what%' OR ipaddress LIKE '%$what%' OR ipaddresslogin LIKE '%$what%')";And it is done!
Last edited by Zoheir (2011-12-09 13:00:24)