View Full Version : IP address from user profile
bashy
05-08-2006, 10:00 PM
Hi peeps
This is my 1st attempt, well actually i was helped by peterska2 of which i am
eternally gratefull :)
I have been wanting a hack like this for a while now, due to users registering
and not posting, because they have not posted, there is no easy way to find
thier IP address other than searching for it in the admincp.
With this hack all you have to do is go into the users profile and the IP image is
there next to the User Options link (see screenshot) click this and you have the
users IP address :)
Hope you find this as usefull as i do!!
Instructions
In the memberinfo template
FIND
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a></td>
</if>
REPLACE WITH
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end -->
</td>
</if>
If you want this for your Moderators as well then please replace the above with this code, With thanks to thalamus for this addition :)
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
 <a href="modcp/user.php?$session[sessionurl]do=doips&username=$userinfo[username]"> <img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end -->
</td>
</if>
Please click install if you use this
EDIT: Now optimised for IE
First Post Reserved :p
Let me try
Thanks for Share
INstalled.Good one bashy,Simple and handy :)
bashy
05-09-2006, 07:49 PM
Ya welcome peeps, tis handy if the member aint posted or ya cant be asked
checking the post to get the IP addy, spose ya can call it a lazy persons hack :)
Boofo
05-09-2006, 09:47 PM
You might want to use:
$admincpdir
instead of
admincp
for those that have renamed their Admin CP directory in the config.php. ;)
akanevsky
05-09-2006, 10:30 PM
Although this MIGHT be handy, it would not be practically useful as many people's IPs change constantly. Therefore, to make this work properly, have it extract either the latest ip used from a post, or generate a list of ips.
wizardan
05-09-2006, 11:57 PM
Very useful.
Bandit8007
05-10-2006, 01:33 AM
nice one. thank you
bashy
05-10-2006, 05:14 AM
Hi Psionic
it does generate a list of IPs used for said member ;)
Although this MIGHT be handy, it would not be practically useful as many people's IPs change constantly. Therefore, to make this work properly, have it extract either the latest ip used from a post, or generate a list of ips.
akanevsky
05-10-2006, 06:07 PM
Oh.. My bad. Heh.
bashy
05-10-2006, 06:17 PM
No worries m8...perhaps i should have stated this :o
Snake
05-10-2006, 06:23 PM
Nice little feature! ;)
bashy
05-10-2006, 06:28 PM
Thank you,
It took a little while to figure out what it was i was after and now its finally
done its been a great help, more so when your trying to keep an eye out for undesireables ;)
Nice little feature! ;)
bashy
05-11-2006, 05:48 PM
Is anyone using this in any IE browsers other than IE 7?
If so and its working can you let me know please?
I am aware of an issue in IE7 and will hopefully be fixed, Unless its a major
glitch with IE7, but i wouldnt have thought so!!
SCORPION1
05-13-2006, 12:18 AM
yes quick install good handy little hack nice one bashy saves a lot of time surfing threw admin stuff by the way no probs running on ff or ie
Hmmm....it crashes and displays wrong if you have the template modified a bit.To avoid this find:
<div class="smallfont">
<b>User ID :</b> $userinfo[userid]<br />
and add underneath:
<!-- Bashy's IP Hack Start --!>
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end --!>
Done.Also it looks much better :D
bashy
05-13-2006, 02:03 PM
Must admit, i didnt have a prob with my memberinfo although i do know someone who did.... I also cannot find
<div class="smallfont">
<b>User ID :</b> $userinfo[userid]<br />
in mine, i have tried a few variants of your code and still nothing :(
Do you have a screener to show how the finished looks please :)
peterska2
05-13-2006, 04:00 PM
Actually, the only thing you need to do if you use a modified memberinfo is to drop a couple of characters from the replace code.
so instead of using
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start --!>
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end --!>
</td>
</if>
use
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end -->
</td>
</if>
I confirm this works correctly in IE and FF.
Bashy, can you update the zip and first post with this snippet instead? Cheers, mate
bashy
05-13-2006, 04:07 PM
Done, i didnt replace the code in the zip and 1st post, i added to the original, this ok or did you want the replacement code replacing?
Actually, the only thing you need to do if you use a modified memberinfo is to drop a couple of characters from the replace code.
so instead of using
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start --!>
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end --!>
</td>
</if>
use
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end -->
</td>
</if>
I confirm this works correctly in IE and FF.
Bashy, can you update the zip and first post with this snippet instead? Cheers, mate
Boofo
05-13-2006, 04:48 PM
Actually, the only thing you need to do if you use a modified memberinfo is to drop a couple of characters from the replace code.
so instead of using
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start --!>
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end --!>
</td>
</if>
use
<if condition="can_moderate()">
<td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]"><img class="inlineimg" src="$stylevar[imgdir_button]/ip.gif" alt="$vbphrase[ip]" title="$post[ip]" border="0" /></a>
<!-- Bashy's IP Hack end -->
</td>
</if>
I confirm this works correctly in IE and FF.
Bashy, can you update the zip and first post with this snippet instead? Cheers, mate
What's different in those 2 pieces of code, Kerry-Anne? They look identical to me, or am I missing something obvious again? ;)
bashy
05-13-2006, 04:51 PM
lol...thats good point...i updated the zip and post but after now loking i dont see any difference myself lol
peterska2
05-13-2006, 05:30 PM
The first one had comments that ended in --!> which is invalid so breaks IE the second has comments that end in --> which is valid.
You know it would be better if he used my code.Just add your code after where is says about the userid: part.It will show next to rep points
peterska2
05-13-2006, 07:25 PM
You know it would be better if he used my code.Just add your code after where is says about the userid: part.It will show next to rep points
ZIKI, it wouldn't as that code is not in a default template, and for anything that touches the templates, the code needs to be available in the default style.
Erm....that is default style.Check out my site.You'll see
peterska2
05-13-2006, 08:22 PM
You are displaying an active link to the acp there. you don't want to do that.
and while you are using the default style, it has that many hacks in that you can't say that the userid code is in the default style. Which I can say for certain it isn't. If in doubt, look at the default template, or go to vB.com and look there, there is NO userid number in the memberinfo template by default. it is something that you have added in.
bashy
05-13-2006, 08:57 PM
Yeah i concure as well, i couldnt find anything with regards to the user ID
Although i do seem to remember a hack that adds this??
MagicMouse
05-15-2006, 01:50 PM
Thanks for this usefull modification.
@peterska2
I don't remember I would add anything like that :confused:
So he can add it after reputation part
Could this be made for version 3.5.2 bashy?
peterska2
06-18-2006, 01:51 PM
It should work in 3.5.2
bashy
06-18-2006, 02:14 PM
Does it not work for 3.5.2 then?
I would have thought it did?
Im sure peterska2 can shed some light on this?
Could this be made for version 3.5.2 bashy?
EDIT: Damn you.....pmsl...
* bashy learns to type faster
Well when i try this nothing shows up in users profile so i thought that it was not compatible with my version. ?
peterska2
06-18-2006, 03:29 PM
Were you logged in as an admin when you tried it?
Were you logged in as an admin when you tried it?
Yes i was, and just to make sure i just tried it again, and still nothing. :confused:
peterska2
06-18-2006, 09:55 PM
strange, because I've got it working in all versions of 3.5 here
thalamus
07-03-2006, 07:08 AM
This is a nice little add-in; however, it only works with admins. Any ideas as to how this can be set to work for moderators of the forum as well? As has been mentioned, it's a direct link to the admincp function which means it needs admin access?
[edit] found the workaround... find in the MEMBERINFO template:
<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]">
and replace with:
<a href="modcp/user.php?$session[sessionurl]do=doips&username=$userinfo[username]">
Should work for both mods and admins with this setting.
bashy
07-03-2006, 06:15 PM
Very good...although i only needed this as admin i didnt think about others...i will add this to the 1st post, thanks again...ps i have added this to my forum now :)
thalamus
08-29-2006, 10:11 AM
Just upgraded one of my boards to 3.6.0, and I get this error:
Security alert: hash mismatch. Please press back, refresh the page, and try again. when I use this modification; anyone else got this, and is there anything in the session variable that needs to be amended?
peterska2
08-29-2006, 10:13 AM
This modification does not work with 3.6.0 and higher. It is untested on 3.5.5 and may or may not work there also.
bashy
09-22-2006, 08:45 AM
You beat mne to it KA :) thanks!
Thats weird, I only just got the email today, that there was a reply......:o
Cybershaolin
02-07-2009, 03:49 PM
This modification does not work with 3.6.0 and higher. It is untested on 3.5.5 and may or may not work there also.
I checked all around and did not see any equivalent for 3.6.8. Any idea if something like that exist for this version?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.