[7.0-7.2.x] Admin IP Information - 11/12/2006 3:13 AM
In .T7 we have the option of having it so the admins (or admins and mods) can see the IP address of a user; through a feature request of Joe Siegler I pieced together a quick modification that will link the displayed IP Address of the user to the address whois on Domain Tools which will provide the admin (or mod) to view where the IP is located, who the ISP is, if its blacklisted, and show what the reverse address search is...
For 7.3+ please see this modification.
There isn't really a demo (as you can't see ip's on my site unless you're an admin/mod), but you can see how the DomainTools.com IP listing looks here.
Posts View:
In scripts/showflat.inc.php:
Find:
Replace With:
In scripts/showthreaded.inc.php:
Find:
Replace With:
In templates/showflat.tpl:
Find:
Replace With:
In templates/showthreaded.tpl:
Find:
Replace With:
Who's Online:
In templates/online.tpl:
Find:
Replace With:
Find:
Replace With:
Find:
Replace With:
Admin User View:
In templates/default/admin/showuser.tmpl:
Find:
Replace With:
Find:
Replace With:
You can change the search engine you use (should you have one you prefer, such as the one at www.dollardns.net which is the original one I tested this on) you can just edit the domain line in /templates/showflat.tpl and /templates/showthreaded.tpl
7.2 Notice: If installing in 7.2, apply the showflat/showthreaded steps to post_side.tpl and post_top.tpl
For 7.3+ please see this modification.
There isn't really a demo (as you can't see ip's on my site unless you're an admin/mod), but you can see how the DomainTools.com IP listing looks here.
Posts View:
In scripts/showflat.inc.php:
Find:
Code
if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
$postrow[$i]['IP'] = "($IP)";
}
elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
$postrow[$i]['IP'] = "($IP)";
}
elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
$postrow[$i]['IP'] = "($IP)";
}
else {
$postrow[$i]['IP'] = "";
}
Replace With:
Code
if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
$postrow[$i]['IP'] = "$IP";
}
elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
$postrow[$i]['IP'] = "$IP";
}
elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
$postrow[$i]['IP'] = "$IP";
}
else {
$postrow[$i]['IP'] = "";
}
In scripts/showthreaded.inc.php:
Find:
Code
if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
$IP = "($IP)";
}
elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod == 'yes') ) && ($IP) ) {
$IP = "($IP)";
}
elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
$IP = "($IP)";
}
else {
$IP = "";
}
Replace With:
Code
if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
$IP = "$IP";
}
elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod == 'yes') ) && ($IP) ) {
$IP = "$IP";
}
elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
$IP = "$IP";
}
else {
$IP = "";
}
In templates/showflat.tpl:
Find:
Code
{if $postrow[post].IP}
<br />
<i>{$postrow[post].IP}</i>
{/if}
Replace With:
Code
{if $postrow[post].IP}
<br />
<i>(<a href="http://whois.domaintools.com/{$postrow[post].IP}" target="_blank">{$postrow[post].IP}</a>)</i>
{/if}
In templates/showthreaded.tpl:
Find:
Code
{if $IP}
<br />
<i>{$IP}</i>
{/if}
Replace With:
Code
{if $IP}
<br />
<i>(<a href="http://whois.domaintools.com/{$postrow[post].IP}" target="_blank">{$postrow[post].IP}</a>)</i>
{/if}
Who's Online:
In templates/online.tpl:
Find:
Code
{$regrow[user].IP}
Replace With:
Code
(<a href="http://whois.domaintools.com/{$regrow[user].IP}" target="_blank">{$regrow[user].IP}</a>)
Find:
Code
{$anonrow[user].IP}
Replace With:
Code
(<a href="http://whois.domaintools.com/{$anonrow[user].IP}" target="_blank">{$anonrow[user].IP}</a>)
Find:
Code
{$botrow[user].IP}
Replace With:
Code
(<a href="http://whois.domaintools.com/{$botrow[user].IP}" target="_blank">{$botrow[user].IP}</a>)
Admin User View:
In templates/default/admin/showuser.tmpl:
Find:
Code
$regip
Replace With:
Code
(<a href="http://whois.domaintools.com/$regip" target="_blank">$regip</a>)
Find:
Code
$lastpostip
Replace With:
Code
(<a href="http://whois.domaintools.com/$lastpostip" target="_blank">$lastpostip</a>)
You can change the search engine you use (should you have one you prefer, such as the one at www.dollardns.net which is the original one I tested this on) you can just edit the domain line in /templates/showflat.tpl and /templates/showthreaded.tpl
7.2 Notice: If installing in 7.2, apply the showflat/showthreaded steps to post_side.tpl and post_top.tpl