php forum
php mysql forum
php mysql smarty
 
Topic Options
#272490 - 04/16/04 11:13 AM Finished-[6.3] Show Unregistered Hostnames
juggaleaux Offline
Lurker

Registered: 03/10/04
Posts: 3

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

Top
#272491 - 04/16/04 11:23 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: beowolf]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
thanx
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#272492 - 04/19/04 06:14 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: beowolf]
Pilgrim Offline
Enthusiast

Registered: 06/17/00
Posts: 325
Loc: Canada
Works well in 6.4.1, although the default code is a bit different in the online.tmpl file than what it is in 6.3.<br /><br />Thanks!

Top
#272493 - 04/20/04 02:58 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Tachyon]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
It works but I get this at top of screen<br />6.4.1<br /><br />Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/steelhea/public_html/ubbthreads/online.php on line 266<br /><br />Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/steelhea/public_html/ubbthreads/online.php on line 266<br /><br />Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/steelhea/public_html/ubbthreads/online.php on line 266<br /><br />Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/steelhea/public_html/ubbthreads/online.php on line 266<br /><br />Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/steelhea/public_html/ubbthreads/online.php on line 266<br /><br />Warning: gethostbyaddr(): Address is not a valid IPv4 or IPv6 address in /home/steelhea/public_html/ubbthreads/online.php on line 266

Top
#272494 - 04/20/04 04:39 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Kelly]
scroungr Offline
Old Hand

Registered: 10/17/03
Posts: 2409
Loc: Richmond, VA
add a @ before the gethostbyaddr so php doesn't broadcast it
_________________________
Couchtomatoe - www.couch-tomatoe.cc
My abilities are for hire for installs, upgrades, custom themes and custom modifications.

Top
#272495 - 04/21/04 02:06 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: 234234]
smilesforu Offline
Junior Member

Registered: 01/31/02
Posts: 676
thanks

Top
#272496 - 04/21/04 07:12 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: beowolf]
Slawek_L Offline
Enthusiast

Registered: 01/28/03
Posts: 364
Loc: Poland, Warsaw
Cool, great thx <img src="http://www.ubbdev.com/forum/images/graemlins/blush.gif" alt="" />k:
_________________________
[]http://www.mb.org.pl/forum/images/graemlins/icon_astro.gif[/] MB Klub Polska
[b]& Orlen-Team

Top
#272497 - 04/22/04 11:35 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Dawg_dup1]
DrChaos Offline
Coder

Registered: 09/12/03
Posts: 816
Loc: Hollywood Florida.
would this work for 6.4.2? nice addon
_________________________
DrChaos
LeetGamers

Top
#272498 - 04/22/04 02:37 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Duck]
PaNTerSan Offline
Journeyman

Registered: 03/19/04
Posts: 122
Loc: EU, Slovenia
It should work with a little workarround <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />I have a question: is there a way to speed gethostbyaddr somehow?<br />With DNS cach information perhaps?<br /><br />My whosonline takes for about 50sec with aprox. 50-70 users online
_________________________
Kind regards,
PaNTerSan

Top
#272499 - 04/27/04 08:52 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: beowolf]
juggaleaux Offline
Lurker

Registered: 03/10/04
Posts: 3
Another idea to improve on this would be to add an option in the preferences in the admin panel.<br /><br />Who's Online Settings<br />( ) Show IP addresses only<br />( ) Show hostnames only<br />( ) Show IP & hostnames<br /><br />If someone could pull that off, that could be added to the core install. It doesn't take a whole lot of code, and it's not too obtrusive.

Top
#272500 - 04/27/04 08:59 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Brandon Long]
PaNTerSan Offline
Journeyman

Registered: 03/19/04
Posts: 122
Loc: EU, Slovenia
[]PaNTerSan said:<br />I have a question: is there a way to speed gethostbyaddr somehow?<br />My whosonline takes for about 50sec with aprox. 50-70 users online [/]<br />I've copied online.php to resolve.php and also the template files, made changes for @gethostbyaddr. Then I added another $adminlink in ubbt.inc.php - so now admins have Resolve and Who's online possibilites. Both serving their purpose <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" />
_________________________
Kind regards,
PaNTerSan

Top
#272501 - 06/11/04 04:26 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Brandon Long]
Mirez Offline
Lurker

Registered: 12/08/03
Posts: 2
We had this running on 6.4. We upgraded recently to 6.5(b1) and I'm glad to say its still fully functional <img src="http://www.ubbdev.com/forum/images/graemlins/smile.gif" alt="" />

Top
#272502 - 06/13/04 04:18 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: calabash23]
DrChaos Offline
Coder

Registered: 09/12/03
Posts: 816
Loc: Hollywood Florida.
im on a new install of 6.5b1 and the directions worked as stated...
_________________________
DrChaos
LeetGamers

Top
#272503 - 12/14/04 01:28 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Duck]
MeNaCe_dup1 Offline
Newbie

Registered: 12/02/04
Posts: 20
can you make this so mods and admin can see the host name?

Top
#272504 - 12/19/04 04:48 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: Barrie]
Twisty Offline
Code Monkey

Registered: 09/26/03
Posts: 524
Easy-peasy, just change the first step above to this instead...<br /><br />In online.php, find this:<br /><br />if ($user['U_Status'] == "Administrator") {<br />$piece['0'] = "";<br />preg_match("/-ANON-(.*)/",$Username,$piece);<br />$Username = $piece['1'];<br />}<br /><br />and change to this:<br /><br />if (($user['U_Status'] == "Moderator") || ($user['U_Status'] == "Administrator") ) {<br />$piece['0'] = "";<br />preg_match("/-ANON-(.*)/",$Username,$piece);<br />$Username = $piece['1'];<br />$hostname = gethostbyaddr($piece['1']);<br />$anonrow[$x]['hostname'] = $hostname;<br />}
_________________________
Twisty []http://www.mameworld.info/misc/nana2.gif[/]
MAMEWorld

Top
#272505 - 12/22/04 12:40 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: smoknz28]
StanCA Offline
Power User

Registered: 07/01/02
Posts: 68
FWIW this works well in 6.5
_________________________
www.clubadventist.com

Top
#272506 - 12/23/04 02:22 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: pdlang]
smoknz28 Offline
Enthusiast

Registered: 04/10/03
Posts: 393
Loc: Washington, D.C.
Installed with v6.5 with no problem-o! <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />Thanks for sharing this code. <img src="http://www.ubbdev.com/forum/images/graemlins/laugh.gif" alt="" />

Top
#272507 - 05/15/05 03:20 AM Re: Finished-[6.3] Show Unregistered Hostnames [Re: General_Failure]
smoknz28 Offline
Enthusiast

Registered: 04/10/03
Posts: 393
Loc: Washington, D.C.
Also, working under v6.5.1.1 without hitches. <img src="http://www.ubbdev.com/forum/images/graemlins/wink.gif" alt="" /><br /><br />The code to replace is the same.<br /><br />You can update the hack to show that it works up to v6.5.1.1

Top
#272508 - 04/19/06 05:54 PM Re: Finished-[6.3] Show Unregistered Hostnames [Re: smoknz28]
Poul Offline
Lurker

Registered: 12/15/02
Posts: 4
[]Twisty said:<br />Easy-peasy, just change the first step above to this instead...<br /><br />In online.php, find this:<br /><br />if ($user['U_Status'] == "Administrator") {<br />$piece['0'] = "";<br />preg_match("/-ANON-(.*)/",$Username,$piece);<br />$Username = $piece['1'];<br />}<br /><br />and change to this:<br /><br />if (($user['U_Status'] == "Moderator") || ($user['U_Status'] == "Administrator") ) {<br />$piece['0'] = "";<br />preg_match("/-ANON-(.*)/",$Username,$piece);<br />$Username = $piece['1'];<br />$hostname = gethostbyaddr($piece['1']);<br />$anonrow[$x]['hostname'] = $hostname;<br />} [/]<br /><br />If You make some changes this for registered users, it will be great <img src="/forum/images/graemlins/smile.gif" alt="" />

Top


Moderator:  Ian_W 
Who's Online
0 Registered (), 19 Guests and 5 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
Blogs, love em or hate em?
by AllenAyres
Yesterday at 02:05 PM
What do you use to edit the files
by Ian_W
10/05/08 03:33 PM
BeyondCompare v3.00
by Ian_W
10/05/08 03:32 PM
Glossy Black Theme with Image Reflection
by Gizmo
10/05/08 02:17 PM
ShareThis
by Gizmo
09/28/08 05:06 AM
[7.3] Viewing MySQL logfiles made easier
by AllenAyres
09/27/08 09:57 PM
Looking for a simple upload script
by Murphdog
09/26/08 08:45 PM
New Mods
[7.3] Viewing MySQL logfiles made easier
by blaaskaak
09/24/08 05:39 PM
[7.3] Language file checker
by blaaskaak
09/09/08 12:56 AM
[7.3.1] add search to showmembers page
by blaaskaak
09/07/08 04:50 AM
Multiple Identity Detector
by
12/30/06 06:39 PM
Newest Members
pisa666, ghengis317, NitroX, Dogan, EliYah-
13345 Registered Users
Top Posters Last 30 Days
blaaskaak 12
AllenAyres 10
FREAK1 7
Mike L_dup1 4
Chris Bale 4
Ian_W 4
tackaberry 4

 

 

 
fusionbb message board php hacks