vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=155)
-   -   IP address from user profile (https://vborg.vbsupport.ru/showthread.php?t=115171)

bashy 05-08-2006 09:00 PM

IP address from user profile
 
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

Code:

    <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a></td>
    </if>

REPLACE WITH

Code:

  <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 -->
&nbsp;<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 :)

Code:

  <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 -->
&nbsp<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

rmxs 05-09-2006 06:40 PM

First Post Reserved :p


Let me try

Thanks for Share

Ziki 05-09-2006 06:40 PM

INstalled.Good one bashy,Simple and handy :)

bashy 05-09-2006 06: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 08:47 PM

You might want to use:

HTML Code:

$admincpdir
instead of

HTML Code:

admincp
for those that have renamed their Admin CP directory in the config.php. ;)

akanevsky 05-09-2006 09: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 10:57 PM

Very useful.

Bandit8007 05-10-2006 12:33 AM

nice one. thank you

bashy 05-10-2006 04:14 AM

Hi Psionic

it does generate a list of IPs used for said member ;)

Quote:

Originally Posted by Psionic Vision
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 05:07 PM

Oh.. My bad. Heh.

bashy 05-10-2006 05:17 PM

No worries m8...perhaps i should have stated this :o

Snake 05-10-2006 05:23 PM

Nice little feature! ;)

bashy 05-10-2006 05: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 ;)

Quote:

Originally Posted by Lil Ripsta
Nice little feature! ;)


bashy 05-11-2006 04: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-12-2006 11:18 PM

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

Ziki 05-13-2006 12:53 PM

Hmmm....it crashes and displays wrong if you have the template modified a bit.To avoid this find:

PHP Code:

   <div class="smallfont">
   <
b>User ID :</b$userinfo[userid]<br /> 

and add underneath:

PHP Code:

<!-- Bashy's IP Hack Start --!>
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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 01:03 PM

Must admit, i didnt have a prob with my memberinfo although i do know someone who did.... I also cannot find
Code:

<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 03: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

Code:

  <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start --!>
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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

Code:

  <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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 03: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?

Quote:

Originally Posted by peterska2
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

Code:

  <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start --!>
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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

Code:

  <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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 03:48 PM

Quote:

Originally Posted by peterska2
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

Code:

  <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start --!>
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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

Code:

  <if condition="can_moderate()">
        <td class="vbmenu_control"><a href="moderator.php?$session[sessionurl]do=useroptions&amp;u=$userinfo[userid]">$vbphrase[user_options]</a>
<!-- Bashy's IP Hack Start -->
&nbsp;<a href="admincp/usertools.php?$session[sessionurl]do=doips&amp;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 03: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 04: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.

Ziki 05-13-2006 06:22 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

peterska2 05-13-2006 06:25 PM

Quote:

Originally Posted by ZIKI-SET
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.

Ziki 05-13-2006 07:09 PM

Erm....that is default style.Check out my site.You'll see

peterska2 05-13-2006 07: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 07: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 12:50 PM

Thanks for this usefull modification.

Ziki 05-17-2006 05:41 PM

@peterska2
I don't remember I would add anything like that :confused:
So he can add it after reputation part

49er 06-18-2006 12:47 PM

Could this be made for version 3.5.2 bashy?

peterska2 06-18-2006 12:51 PM

It should work in 3.5.2

bashy 06-18-2006 01: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?

Quote:

Originally Posted by teepeg
Could this be made for version 3.5.2 bashy?


EDIT: Damn you.....pmsl...
[high]* bashy learns to type faster[/high]

49er 06-18-2006 01:25 PM

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 02:29 PM

Were you logged in as an admin when you tried it?

49er 06-18-2006 03:34 PM

Quote:

Originally Posted by peterska2
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 08:55 PM

strange, because I've got it working in all versions of 3.5 here

thalamus 07-03-2006 06: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:
Code:

<a href="admincp/usertools.php?$session[sessionurl]do=doips&username=$userinfo[username]">
and replace with:
Code:

<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 05: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 09:11 AM

Just upgraded one of my boards to 3.6.0, and I get this error:
Code:

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 09: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.


All times are GMT. The time now is 03:56 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02369 seconds
  • Memory Usage 1,837KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (13)bbcode_code_printable
  • (2)bbcode_html_printable
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (1)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete