Page 1 of 1

IP address?

Posted: 14. April 2009 05:15
by dudenell
I was hoping to put something on the front page (particularly in the menu if possible) that will display the users IP address. I can't seem to find a simple way to do this. It would just be
your IP is: 235.234.23.123

Re: IP address?

Posted: 14. April 2009 07:01
by Kevin
Code could be easily found with google. e.g. http://php.about.com/od/learnphp/p/what_my_ip.htm
Just search for "my ip script".
If you dont get along to implement it into the portal, just let me know.

Re: IP address?

Posted: 14. April 2009 07:31
by dudenell
alright well I had someone help me out with this, its for subsilver2, I'm sure it wont be hard to figure it out for prosilver

open portal.php
Find

Code: Select all

$load_center = true;
after add:

Code: Select all

$template->assign_vars(array('USERIP' => $_SERVER['REMOTE_ADDR']));
save the file and upload

Then open *your directory*/styles/subsilver2/template/portal/block/main_menu.html
find

Code: Select all

	<tr class="row1">
		<td>
			<a href="{U_TEAM}">{L_THE_TEAM}</a>
		</td>
	</tr>
after add

Code: Select all

	<tr class="row1">
		<td>
			Your IP: {USERIP}</a>
		</td>
	</tr>
clear the cache and you should have a display.