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
Page 1 of 2 1 2 >


Moderator:  sirdude 
Who's Online
2 registered (arentzen, blaaskaak), 27 Guests and 8 Spiders online.
Key: Admin, Global Mod, Mod
Shout Box

Latest Posts
How to hide sub forums from summary page
by blaaskaak
12/03/08 09:54 AM
Spell Check [beta]
by Bill B
12/01/08 09:16 PM
PhotoPost BB Code Popup
by AllenAyres
12/01/08 09:41 AM
Problems reading a lot of old posts here
by AllenAyres
12/01/08 09:35 AM
Forum 'Trader Ratings'.
by AllenAyres
12/01/08 09:33 AM
Customization needed
by Gizmo
11/12/08 12:28 PM
Team UBBDev Rides Again!
by AllenAyres
11/11/08 02:16 PM
New Mods
User Authentication Class
by
01/19/07 02:59 PM
Multiple Identity Detector
by
12/30/06 06:39 PM
PhotoPost BB Code Popup
by
11/06/06 05:43 PM
Spell Check [beta]
by
10/17/06 09:24 PM
Newest Members
David DelMonte, nick1, Begbie, cenk, MATTO
13363 Registered Users
Top Posters
AllenAyres 25452
JoshPet 11330
Rick 8372
LK 7396
Lord Dexter 6503
Greg Hard 5533
Charles Capps 5438