UBB.Dev
Posted By: CTM [6.7] [finished] Logged And Resolved IP Addresses - 02/08/2004 12:28 AM
Modification Name: Logged And Resolved IP Addresses

Author(s): CTM

Description: This modification attempts to resolve an IP address to give a host name when an Administrator or Moderator looks up a poster's IP address from the topic pages. If the IP address cannot be resolved, a "cannot be resolved" message will be shown instead. Also displays the resolved host name of visitors to the UBB in the "Recent Visitors" admin view. Useful for determining which ISP a visitor is using, or the country in which he or she lives. Fully Wordlet-ised.

Demo: "IP: Logged" link from post , PNTF admin view

Requirements: Valid UBB.classic license

Download Link: http://www.iphq.net/site/ubb/hacks/6.7/logged_and_resolved_ip.txt

Make sure that you don't go past the point I've specified in the mod installation instructions if you've already installed version 1.0.0 of this mod. It's clearly marked. wink

In order for this to work properly, your web server must have a version of Perl that is capable of using Socket. Saying that, most versions of Perl do, so that shouldn't be a problem.

For a Colorforums-compatible version of the template, see Trekkie\'s post in this thread . Thanks Trekkie! smile

This is my first hack for the new 6.6+ series, I hope it goes down well... smile
smile works great, thanks
GJ chris, can't wait to get her runnin smile .
And for those that want to use this hack with Colorofurms 6.7 just do the following for the public_show_ip.pl portion of the instructions:

Find:
Code
<tr class="lighttable">
<td width="20%">
<b>$vars_wordlets{ip}</b>
</td>
<td>
<b>$ip_number</b>
</td></tr>
Add after:
Code
<tr class="lighttable">
<td width="20%">
<b>$vars_wordlets{host}</b>
</td>
<td>
<b>$ip_host</b>
</td></tr>
Thanks for the hint, Trekkie, I'll link to that in the top post. smile
You're welcome, just trying to give a little something back.
Chris, any chance of you adding this to pntf, so that in admin view we can see hosts?
Will do in the next version, along with a couple of other features smile
laugh a new version? hehe... :cant wait:
Already done an hour ago wink
umm chris...

This:
Code
Find:
=====

<td bgcolor="$vars_style{$colors[0]}" width="15%">$vars_style{FontTag}
$iplist
</font></td>

Replace with:
=============

<td bgcolor="$vars_style{$colors[0]}" width="25%">$vars_style{FontTag}
$hostlist
</font></td>
Should be:
Code
Find:
=====

<td bgcolor="$vars_style{$colors[0]}" width="15%">$vars_style{FontTag}
$iplist
</font></td>

add under:
=============

<td bgcolor="$vars_style{$colors[0]}" width="25%">$vars_style{FontTag}
$hostlist
</font></td>
shouldn't it?
Yeah, it should, but I can't type... wink

Thanks James, all updated. smile
Heh yup; I went and looked at the page and was all "humm, this doens't look right at all" lol...
for those who want the look to match the normal pattern, change

Code
<td bgcolor="$vars_style{$colors[0]}" width="25%">$vars_style{FontTag}
$hostlist
</font></td>
to

Code
<td bgcolor="$vars_style{$colors[1]}" width="25%">$vars_style{FontTag}
$hostlist
</font></td>
Al, i think that's probably what he wanted anyway, seeing as it begun as a replace :x...
Also fixed wink

Before I close my editor, is that all the bugs sorted now? wink
Chris, this is awesome! I just noticed " crawl6.googlebot.com" in my list of recent visitors. Now I know when I'm being crawled laugh
*.inktomisearch.com love me...
Yeah, Inktomi is the most active search engine content indexer...
I wouldn't go that far... It's a war between GoogleBot and Inktomi on UGN :x...
Thanks, this works great! Even I could install it. laugh
A neat modification I added to this.

FIND:
Code
			$thishost = gethostbyaddr(inet_aton($thisip), AF_INET) or $thishost = $thisip;
ADD AFTER:
Code
			if($thishost =~ /google/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{google}/isg;
}elsif($thishost =~ /inktomi/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{inktomi}/isg;
}elsif($thishost =~ /msn/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{MSN}/isg;
}elsif($thishost =~ /turnit/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{turnitin}/isg;
}elsif($thishost =~ /jeeves/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{jeeves}/isg;
}elsif($thishost =~ /scooter/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{altavista}/isg;
}elsif($thishost =~ /turnit/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{turnitin}/isg;
}elsif($thishost =~ /fast-web/) {
$pdn =~ s/(<i>)(.+?)(</i>)/$vars_wordlets_pntf{alltheweb}/isg;
}
Then add the following lines to vars_wordlets_pntf.cgi

Code
    q!google! => q!GoogleBot!,
q!jeeves! => q!Ask Jeeves.com!,
q!altavista! => q!Alta-Vista!,
q!alltheweb! => q!AllTheWeb!,
q!turnitin! => q!TurnItIn.com!,
q!inktomi! => q!Inktomi!,
q!MSN! => q!MSN.com!,
This makes it so those spiders show up as members (ie, not listed as Guest xxxx) in the Admin View.

I could make this larger if anyone knows spiders and identifying traits so they can be distinguished via resolved IPs
Ian, look through the awstats files, they have a load...
Help please, I added this hack including Ian's addition to the hack but it is not showing IP addresses or hostnames... frown
Would you mind PMing me details of an administrator account for your UBB please? It'd speed up the problem-solving process a lot. Thanks. smile
I just removed this from my forums, at least the pntf part. Resolving all of those IPs slowed the page down considerably
I've been using this mod for some time now with no special problems
© UBB.Developers