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

Wizard

Registered: 01/10/00
Posts: 5354
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...

For 7.3+ please see this modification.

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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

I type Like navaho

Registered: 03/10/00
Posts: 25580
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 Offline

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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 Offline

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

Registered: 04/05/01
Posts: 97
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: 5
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]
SGHB1138 Offline
Power User

Registered: 01/01/07
Posts: 59
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.
_________________________
Stephen G
Give Yourself to the Geek Side @
http://cinemageek.co.uk

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

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

Registered: 04/05/01
Posts: 97
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 Offline

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

Registered: 04/05/01
Posts: 97
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 Offline

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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 Offline

Wizard

Registered: 01/10/00
Posts: 5354
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 & Development President
UBB.Threads: My UBBSkins, UBB.Sitemaps

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 
Latest Posts
[7.2.1] - Naked shoutbox
by bellaonline
05/05/12 05:00 PM
[7.x] Stop Forum Spam Integration v0.4
by bellaonline
05/05/12 03:53 PM
Shout Box

(Views)Popular Topics
Known public proxy servers 1689885
Integrated Index Page (IIP) 5.3.1 555705
Finished-[6.5.2] Games Arcade Deluxe v1.9 501236
Integrated Index Page (IIP) 5.1.1 415112
TLD Bv2.1 Released - Threads Links Directory 396822
[6.0x] Who's Online 4.0.0 [Finished] 389412
Finished-[6.5.1] Integrated Index Page (IIP) 6.5 330423
Q & A 298663
Slash UBB 266936
[6.3.x] [beta] Hit Hack 2.0 227970
Forum Stats
13621 Members
59 Forums
37191 Topics
295716 Posts

Max Online: 686 @ 06/28/07 07:04 AM

 

 

 
fusionbb message board php hacks