php forum
php mysql forum
php mysql smarty
 
Page 1 of 2 1 2 >
Topic Options
#311949 - 11/11/06 07:13 PM [7.x] Admin IP Information
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
In .T7 we have the option of having it so the admins (or admins and mods) can see the IP address of a user; through a feature request of Joe Siegler I pieced together a quick modification that will link the displayed IP Address of the user to the address whois on Domain Tools which will provide the admin (or mod) to view where the IP is located, who the ISP is, if its blacklisted, and show what the reverse address search is...

There isn't really a demo (as you can't see ip's on my site unless you're an admin/mod), but you can see how the DomainTools.com IP listing looks here.

Posts View:
In scripts/showflat.inc.php:
Find:
Code:
		if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
			$postrow[$i]['IP'] = "($IP)";
		}

		elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
			$postrow[$i]['IP'] = "($IP)";
		}
		elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
			$postrow[$i]['IP'] = "($IP)";
		}
		else {
			$postrow[$i]['IP'] = "";
		}


Replace With:
Code:
		if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
			$postrow[$i]['IP'] = "$IP";
		}

		elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod=='yes') ) && ($IP) ) {
			$postrow[$i]['IP'] = "$IP";
		}
		elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
			$postrow[$i]['IP'] = "$IP";
		}
		else {
			$postrow[$i]['IP'] = "";
		}



In scripts/showthreaded.inc.php:
Find:
Code:
	if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
		$IP = "($IP)";
	}
	elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod == 'yes') ) && ($IP) ) {
		$IP = "($IP)";
	}
	elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
		$IP = "($IP)";
	}
	else {
		$IP = "";
	}


Replace With:
Code:
	if ( ($config['SHOW_POSTER_IP'] == 1) && $IP) {
		$IP = "$IP";
	}
	elseif ( ($config['SHOW_POSTER_IP'] == 2) && ( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($ismod == 'yes') ) && ($IP) ) {
		$IP = "$IP";
	}
	elseif ( ($config['SHOW_POSTER_IP'] == 3) && ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") && ($IP) ) {
		$IP = "$IP";
	}
	else {
		$IP = "";
	}


In templates/showflat.tpl:
Find:
Code:
{if $postrow[post].IP}
<br />
<i>{$postrow[post].IP}</i>
{/if}


Replace With:
Code:
{if $postrow[post].IP}
<br />
<i>(<a href="http://whois.domaintools.com/{$postrow[post].IP}" target="_blank">{$postrow[post].IP}</a>)</i>
{/if}


In templates/showthreaded.tpl:
Find:
Code:
{if $IP}
<br />
<i>{$IP}</i>
{/if}


Replace With:
Code:
{if $IP}
<br />
<i>(<a href="http://whois.domaintools.com/{$postrow[post].IP}" target="_blank">{$postrow[post].IP}</a>)</i>
{/if}




Who's Online:
In templates/online.tpl:
Find:
Code:
{$regrow[user].IP}


Replace With:
Code:
(<a href="http://whois.domaintools.com/{$regrow[user].IP}" target="_blank">{$regrow[user].IP}</a>)


Find:
Code:
{$anonrow[user].IP}


Replace With:
Code:
(<a href="http://whois.domaintools.com/{$anonrow[user].IP}" target="_blank">{$anonrow[user].IP}</a>)


Find:
Code:
{$botrow[user].IP}


Replace With:
Code:
(<a href="http://whois.domaintools.com/{$botrow[user].IP}" target="_blank">{$botrow[user].IP}</a>)




Admin User View:
In templates/default/admin/showuser.tmpl:
Find:
Code:
$regip


Replace With:
Code:
(<a href="http://whois.domaintools.com/$regip" target="_blank">$regip</a>)


Find:
Code:
$lastpostip


Replace With:
Code:
(<a href="http://whois.domaintools.com/$lastpostip" target="_blank">$lastpostip</a>)


You can change the search engine you use (should you have one you prefer, such as the one at www.dollardns.net which is the original one I tested this on) you can just edit the domain line in /templates/showflat.tpl and /templates/showthreaded.tpl

7.2 Notice: If installing in 7.2, apply the showflat/showthreaded steps to post_side.tpl and post_top.tpl
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#311950 - 11/11/06 09:29 PM Re: Admin IP Information [Re: Gizmo]
AllenAyres Administrator Offline
I type Like navaho

Registered: 03/10/00
Posts: 25452
Loc: Texas
Nice, thank you Gizzy smile
_________________________
- Allen wavey
- What Drives You?

Top
#311951 - 11/12/06 02:13 AM Re: Admin IP Information [Re: AllenAyres]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Yes, I made a use for the ip listing lol... it just seemed so lonely sitting there as a number, i wanted the ability to click it lol...

I should put a blank location in the link code...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#311952 - 11/12/06 02:15 AM Re: Admin IP Information [Re: Gizmo]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
there, updated the code block to add in a target location of a blank window; if you don't want it to go to a blank window, simply remove the target="_blank" from the link code in the last step.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#311974 - 11/15/06 07:47 AM Re: Admin IP Information [Re: Gizmo]
Harold Offline
Power User

Registered: 10/20/05
Posts: 82
Loc: Defiance, Ohio
I wonder how this will work with the new online features being added with version 7.1? I haven't installed any real hacks yet and this would be one of the first ones along with several others that I would place in the "must haves" category.

Top
#311978 - 11/15/06 04:35 PM Re: Admin IP Information [Re: Harold]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
'eh I'll make something compatable when the time comes (should it not be compatable), even if i have to add that magnifying glass icon with a link for the ip information wink...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#312137 - 12/02/06 03:06 PM Re: Admin IP Information [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 93
Loc: NJ

Here are some additions to Gizzy's mod (you need to implement his first before adding these):


TO HYPERLINK IP ADDRESSES IN ADMIN VIEW OF A USER'S PROFILE

EDIT: /templates/default/admin/showuser.tmpl

On or near Line 88:

CHANGE:
Code:
$regdate - $regip

TO:
Code:
$regdate - <a href="http://whois.domaintools.com/$regip" target="_blank">$regip</a>


AND on or near Line 96:

CHANGE:
Code:
$lastpost - $lastpostip

TO:
Code:
$lastpost - <a href="http://whois.domaintools.com/$lastpostip" target="_blank">$lastpostip</a>



TO HYPERLINK IP ADDRESSES IN WHO'S ONLINE


EDIT: /templates/default/online.tpl

On or near Line 36:

CHANGE:
Code:
<span class="small">{$regrow[user].IP}</span>

TO:
Code:
<span class="small"><a href="http://whois.domaintools.com/{$regrow[user].IP}" target="_blank">{$regrow[user].IP}</a></span>


AND on or near Line 82:

CHANGE:
Code:
{$anonrow[user].Username}

TO:
Code:
<a href="http://whois.domaintools.com/{$anonrow[user].Username}" target="_blank">{$anonrow[user].Username}</a>


/jg
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#312903 - 01/25/07 06:48 AM Re: Admin IP Information [Re: Gizmo]
Ohton Offline
Lurker

Registered: 06/30/02
Posts: 4
I am not sure I understand, gizmo's code in find is the same as window to replace?

and i can't see the code in the last window from another post.

Top
#312910 - 01/25/07 11:49 AM Re: Admin IP Information [Re: Ohton]
GEN Offline
Power User

Registered: 01/01/07
Posts: 52
Loc: UK
I got it to work by editing in `showflat.inc.php` and `showflat.tpl` but couldn't find the same code in `showthreaded.inc.php` or `showthreaded.tpl` (no biggie for me as I view in `flat` not `thread`).

Would love to add jgeoff`s additions but can't see the altered code either.
_________________________
GEN
Give Yourself to the Dark Side @ http://www.galacticempire.net
Give Yourself to the Geek Side @ http://www.movingimagetoys.com
"Anakin, duck!"
"What's a duck?"

Top
#312914 - 01/25/07 02:35 PM Re: Admin IP Information [Re: GEN]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Yeh some files changed; i'll update this over the weekend
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#313450 - 03/08/07 03:24 PM Re: Admin IP Information [Re: Gizmo]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Updated initial post with changes in 7.1 (for 7.0 users, simply ignore the search engines section of online.tpl). Also incorporated jgeoff's additions.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#313589 - 03/17/07 06:45 PM Re: Admin IP Information [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 93
Loc: NJ

Giz, what would these be changed to in membersearch.tmpl?
Code:
<i>{$ubbt_lang['LAST_IP']}</i> &nbsp; {$result[$i]['lastpostip']}

<i>{$ubbt_lang['REG_IP']}</i> &nbsp; {$result[$i]['regip']}

I'm afraid to play with those for some reason... laugh
_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#313591 - 03/17/07 06:55 PM Re: Admin IP Information [Re: jgeoff]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
In membersearch.tmpl
Find:
Code:
<i>{$ubbt_lang['LAST_IP']}</i> &nbsp; {$result[$i]['lastpostip']}


And:
Code:
<i>{$ubbt_lang['REG_IP']}</i> &nbsp; {$result[$i]['regip']}


Replace with:
Code:
<i>{$ubbt_lang['LAST_IP']}</i> &nbsp; <a href="http://whois.domaintools.com/{$result[$i]['lastpostip']}" target="_blank">{$result[$i]['lastpostip']}</a>


And:
Code:
<i>{$ubbt_lang['REG_IP']}</i> &nbsp; <a href="http://whois.domaintools.com/{$result[$i]['regip']}" target="_blank">{$result[$i]['regip']}</a>
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#313593 - 03/17/07 07:17 PM Re: Admin IP Information [Re: Gizmo]
jgeoff Offline
Power User

Registered: 04/05/01
Posts: 93
Loc: NJ

Not so bad... great, thanks! cool

_________________________
GangsterBB.NET (Ver. 7.3)
2007 Content Rulez Contest - Honorable Mention
UBB.classic 6.7.2 - RIP
Browser: Firefox 2.0

Top
#314149 - 05/20/07 05:33 AM Re: Admin IP Information [Re: jgeoff]
cclapper Offline
Lurker

Registered: 05/20/07
Posts: 2
DomainTools have nice API which could be connected with this feature. Altough, they have some limitation. After certain number of queries you have to start paying frown
_________________________
http://www.you-switch.org - Youswitch provides advice on switching utility bills.
http://www.broardband.net - broadband advice

Top
#314150 - 05/20/07 06:15 AM Re: Admin IP Information [Re: cclapper]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
It'd be ok as a seperate modification; this one allows users to use any number of free services that are readily available.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#314749 - 07/16/07 10:06 PM Re: Admin IP Information [Re: Gizmo]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Updated initial post with:
Originally Posted By: Gizmo
7.2 Notice: If installing in 7.2, apply the showflat/showthreaded steps to post_side.tpl and post_top.tpl
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#314860 - 07/21/07 07:15 PM Re: [7.x] Admin IP Information [Re: Gizmo]
Mike G Offline
Newbie

Registered: 05/28/07
Posts: 11
Hi, not sure how to include Moderators in the ability to lookup IP info.

( ($user['USER_MEMBERSHIP_LEVEL'] == "Administrator")

Not super proficient with PHP so I don't know the proper method to specify more than one membership level.

Top
#314861 - 07/21/07 09:02 PM Re: [7.x] Admin IP Information [Re: Mike G]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Going to drop the beginning ( from your post and work only with the "guts".

As this allows only the admin:
($user['USER_MEMBERSHIP_LEVEL'] == "Administrator")

This SHOULD allow both an admin and a mod.
(($user['USER_MEMBERSHIP_LEVEL'] == "Administrator") || ($user['USER_MEMBERSHIP_LEVEL'] == "Moderator"))
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#314862 - 07/21/07 09:20 PM Re: [7.x] Admin IP Information [Re: Gizmo]
Mike G Offline
Newbie

Registered: 05/28/07
Posts: 11
Thanks Gizmo, that did the trick!


Top
#314895 - 07/22/07 08:37 PM Re: [7.x] Admin IP Information [Re: Mike G]
Rose Offline
Power User

Registered: 09/29/06
Posts: 76
I'm very confused. Giz, is your first script up-to-date with all the changes in the rest of the thread?

Thanks, I'd like to apply this mod. smile

Top
#314897 - 07/23/07 12:21 AM Re: [7.x] Admin IP Information [Re: Rose]
Mike G Offline
Newbie

Registered: 05/28/07
Posts: 11
Originally Posted By: Rose
I'm very confused. Giz, is your first script up-to-date with all the changes in the rest of the thread?

Thanks, I'd like to apply this mod. smile


Hi Rose,

I took Gizmo's online "how to" and updated it for v7.2 and put it into an attachment. Also incorporated the Admin/Mod update he helped me with the other night. Just take a look at the attachment, it is commented for that section. As is it will allow both Admins and Mod's to view IP details.

[Gizmo, Mod's... feel free to relocate this attachment to the inital post if you wish]




Attachments
2453-AdminIPInfo7.2.txt (23 downloads)


Top
#314901 - 07/23/07 02:33 AM Re: [7.x] Admin IP Information [Re: Mike G]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
It shouldn't be too much differant in 7.2; granted the showflat/showthreaded steps apply elsewhere, but i commented on that in the original post... I'm not sure what all would be differant; it's honestly just looking for the ip areas, I applied this on my sites but i'm not sure how much of the "how to" i actually followed in 7.2...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#314907 - 07/23/07 10:04 AM Re: [7.x] Admin IP Information [Re: Gizmo]
Mike G Offline
Newbie

Registered: 05/28/07
Posts: 11
Originally Posted By: Gizmo
It shouldn't be too much differant in 7.2; granted the showflat/showthreaded steps apply elsewhere, but i commented on that in the original post... I'm not sure what all would be differant; it's honestly just looking for the ip areas, I applied this on my sites but i'm not sure how much of the "how to" i actually followed in 7.2...


Just minor things, like path to the template files (added the /default/ path) removing the reference to showthreaded since it dosesn't exist (at least on my v7.2 installation) and included the blurb on Admin & Mod permissions.

I like having the mod's in a text file as well since I can store that information for future reference.


Top
#314908 - 07/23/07 11:21 AM Re: [7.x] Admin IP Information [Re: Mike G]
Rose Offline
Power User

Registered: 09/29/06
Posts: 76
Thanks Mike and Gizmo! smile

Top
#317280 - 06/24/08 02:11 PM Re: [7.x] Admin IP Information [Re: Rose]
winter Offline
Lurker

Registered: 09/10/03
Posts: 3
Loc: Salt Lake City, Utah
This is very nice, and is something I wish was included in the standard code. We always check a new members IP# (and their email address via Google) to see what info turns up before we approve them.

Do you know if it is possible to do this with some other DNS sites? For instance the site http://www.ipligence.com/geolocation/# is sort of nice because it provides a map of the location (as do several other sites). But it looks like the IP# info is generated once you enter the number in their form and submit it. Is there anyway to do that with something like what the modifications listed here?

Mark

Top
#317283 - 06/24/08 07:18 PM Re: [7.x] Admin IP Information [Re: winter]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
So long as they allow input via the URL youc an use anyone; simply change the default url in your install.
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
#317289 - 06/25/08 09:47 AM Re: [7.x] Admin IP Information [Re: Gizmo]
winter Offline
Lurker

Registered: 09/10/03
Posts: 3
Loc: Salt Lake City, Utah
Thanks for responding Gizmo. I think the problem is that they don't allow input via the URL. Most of these sites return the IP informtion for the person who is accessing the page. So in the case of ipligence.come (and several others)if I put their URL in then when an Admin clicks on a users IP# they get information about themselves instead of info for the user.

The sites are set up with a form where you have to type in the ip# you want info on if you are not inquiring about your own IP. I don't know if it is possible to setup a URL which will pass the ip number to the form and submit it? That is what I was hoping was possible, but I suspect it is not.

Not a big deal, but the tie in to Google maps is helpful to get a sense of where they are.

Anyway, thanks again,
Mark

Top
#317290 - 06/25/08 08:14 PM Re: [7.x] Admin IP Information [Re: winter]
Gizmo Administrator Offline
Wizard

Registered: 01/10/00
Posts: 5133
Loc: Portland, OR, USA
Well, it'd be a little more involved than that... Those which allow input via URL use the GET input, wheres others use POST which would require them allowing outside input in the first place...
_________________________
UBB.Dev - Where you too can render your UBB install completely useless...
UGN Security, Elite Web Gamers & VNC Web Design Owner

Top
Page 1 of 2 1 2 >


Moderator:  sirdude