Previous Thread
Next Thread
Print Thread
Rate Thread
Joined: Jul 2003
Posts: 26
User
User
Joined: Jul 2003
Posts: 26
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.


Attachments
97219-Lookup Poster IP Address.txt (0 Bytes, 66 downloads)

Sponsored Links
Joined: Mar 2001
Posts: 644
Member
Member
Offline
Joined: Mar 2001
Posts: 644
That could be handy! Thanks.

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Nice thanks.

Joined: Jan 2003
Posts: 141
Journeyman
Journeyman
Offline
Joined: Jan 2003
Posts: 141
I have installed this and it works great. I like a different ip locator better but I have tried everything I can think of (which isn't much) to make it work. Will it work with this service? http://www.geobytes.com/IpLocator.htm?GetLocation If so, what do I need to put in the generic.php file?

Last edited by dman; 10/28/2003 11:36 PM.
Joined: Jul 2003
Posts: 26
User
User
Joined: Jul 2003
Posts: 26
I actually use a different whois Proxy now too

http://grove.ufl.edu/~bro/cgi-bin/wp.cgi?query=

You can just change the language file to reflect the url of this or what ever whois proxy you like. So to use this other one it would look like this.

$ubbt_lang['GET_IP_URL'] = "http://grove.ufl.edu/~bro/cgi-bin/wp.cgi?query=";

The way this works is pretty simple, it just slaps the IP address on the end of that URL so it gets passed as a parameter to the Whois Proxy like http://grove.ufl.edu/~bro/cgi-bin/wp.cgi?query=68.6.40.116

I Checked out that GeoBytes site and the problem I think that you are having is that I do not see any way to pass the IP address as a parameter to the URL you indicated.


Sponsored Links
Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
Post deleted by smoknz28

Joined: Apr 2003
Posts: 359
Enthusiast
Enthusiast
Joined: Apr 2003
Posts: 359
I was the guinney pig on this one.... It works with no problems that I've uncovered after installing and running it on a few IPs under Threads v6.4.

Just a heads up... Thanks for this hack!

SHinZ #260887 01/19/2004 12:41 PM
Joined: Jan 2003
Posts: 338
Enthusiast
Enthusiast
Offline
Joined: Jan 2003
Posts: 338


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
badfrog
badfrog
somewhere on the coast of Maine
Posts: 94
Joined: March 2007
Forum Statistics
Forums63
Topics37,575
Posts293,930
Members13,823
Most Online6,139
Sep 21st, 2024
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2025 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.1
(Snapshot build 20240918)