Mod Name / Version: Show Unregistered Hostnames
Description: Shows the hostname of anonymous users on the "Who's Online" screen under the IP.
For example under 64.68.86.38 will show crawler2.googlebot.com
Working Under: UBB.Threads 6.3
Mod Status: Finished
Any pre-requisites: Author(s): juggaleaux
Date: 04/16/04
Credits: Files Altered: online.php
/templates/default/online.tmpl
New Files: none
Database Altered: none
Info/Instructions: a demo is
hereIn online.php, find this:
if ($user['U_Status'] == "Administrator") {
$piece['0'] = "";
preg_match("/-ANON-(.*)/",$Username,$piece);
$Username = $piece['1'];
}
and change to this:
if ($user['U_Status'] == "Administrator") {
$piece['0'] = "";
preg_match("/-ANON-(.*)/",$Username,$piece);
$Username = $piece['1'];
$hostname = gethostbyaddr($piece['1']);
$anonrow[$x]['hostname'] = $hostname;
}
In online.tmpl find this:
<td class="{$anonrow[$i]['color']}">
{$anonrow[$i]['Username']}
</td>
and change it to this:
<td class="{$anonrow[$i]['color']}">
{$anonrow[$i]['Username']}<BR>
<small>{$anonrow[$i]['hostname']}</small>
</td>
I've only tested this on 6.3, but it should work on some other versions as well.
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.