Mod Name / Version: Lookup IP address of Poster
Description: This mod turns the IP address displayed in a user's post into a hyperlink that queries a Whois Proxy with the IP address. I used
www.nic.com but you may substitute with others.
We only disply IP addresses to Admin/Moderators and this makes it easy for them to quickly see where someone really is if they didn't enter their company name in their profile
Working Under: UBB.Threads 6.3
Mod Status: Finished
Any pre-requisites: None
Author(s): PatrickEgan
Date: 10/17/03
Credits: Files Altered: showflat.php, showthreaded.php and languages/generic.php
New Files: None
Database Altered: None
Info/Instructions: Follow the instructions below
In languages/generic.php
Add the following two lines:
$ubbt_lang['GET_IP_TEXT'] = "Lookup this IP Address";
$ubbt_lang['GET_IP_URL'] = "http://www.nic.com/cgi-bin/wp.cgi?query=";
In showflat.php
Find This:
if ( ($config['showip'] == 1) && $IP) {
$postrow[$i]['IP'] = "($IP)";
}
elseif ( ($config['showip'] == 2) && ( ($user['U_Status'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
$postrow[$i]['IP'] = "($IP)";
}
elseif ( ($config['showip'] == 3) && ($user['U_Status'] == "Administrator") && ($IP) ) {
$postrow[$i]['IP'] = "($IP)";
}
Change to This:
if ( ($config['showip'] == 1) && $IP) {
$postrow[$i]['IP'] = "<a title="{$ubbt_lang['GET_IP_TEXT']}" href="{$ubbt_lang['GET_IP_URL']}$IP">($IP)</a>";
}
elseif ( ($config['showip'] == 2) && ( ($user['U_Status'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
$postrow[$i]['IP'] = "<a title="{$ubbt_lang['GET_IP_TEXT']}" href="{$ubbt_lang['GET_IP_URL']}$IP">($IP)</a>";
}
elseif ( ($config['showip'] == 3) && ($user['U_Status'] == "Administrator") && ($IP) ) {
$postrow[$i]['IP'] = "<a title="{$ubbt_lang['GET_IP_TEXT']}" href="{$ubbt_lang['GET_IP_URL']}$IP">($IP)</a>";
}
In showthreaded.php
Find This
if ( ($config['showip'] == 1) && $IP) {
$IP = "($IP)";
}
elseif ( ($config['showip'] == 2) && ( ($user['U_Status'] == "Administrator") || ($ismod == 'yes') ) && ($IP) ) {
$IP = "($IP)";
}
elseif ( ($config['showip'] == 3) && ($user['U_Status'] == "Administrator") && ($IP) ) {
$IP = "($IP)";
}
Change to This:
if ( ($config['showip'] == 1) && $IP) {
$IP = "<a title="{$ubbt_lang['GET_IP_TEXT']}" href="{$ubbt_lang['GET_IP_URL']}$IP">($IP)</a>";
}
elseif ( ($config['showip'] == 2) && ( ($user['U_Status'] == "Administrator") || ($ismod == 'yes') ) && ($IP) ) {
$IP = "<a title="{$ubbt_lang['GET_IP_TEXT']}" href="{$ubbt_lang['GET_IP_URL']}$IP">($IP)</a>";
}
elseif ( ($config['showip'] == 3) && ($user['U_Status'] == "Administrator") && ($IP) ) {
$IP = "<a title="{$ubbt_lang['GET_IP_TEXT']}" href="{$ubbt_lang['GET_IP_URL']}$IP">($IP)</a>";
}
Disclaimer: Please backup every file that you intend to modify.
If the modification modifies the database, it's a good idea to backup your database before doing so.
Note: If you modify your UBB.Threads code, you may be giving up your right for "official" support from Infopop.If you need official support, you'll need to restore unmodified files.