X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   IP Addresses in Users Online for all users (https://forum.x-cart.com/showthread.php?t=16571)

laurieblake 02-21-2007 12:01 PM

Re: IP Addresses in Users Online for all users
 
Quote:

Originally Posted by laurieblake
Nor can I in 4.1.5. If someone has it working it would be great if you could compliment the original good-hearted post and post the full code.

Cheers


Just to explain, in the "Users Online" Statistics screen under customer i see Unregistered customer IP: and no IP address. Any ideas?

laurieblake

snowman99 03-09-2007 11:18 AM

Re: IP Addresses in Users Online for all users
 
Hi,
I just implemented this on 4.1.3 with no problem. I entered the code exactly as specified.

Try replacing the session_ip variable with a literal string in the auth.php file.
$session_ip = "1.2.3.4"; This is just to make sure the rest of the code works in the other two files. If it works then you know the problem is in the auth.php code. If it doesn't you know it's further down in either the stats.php or stats.tpl code.

laurieblake 03-09-2007 03:46 PM

Re: IP Addresses in Users Online for all users
 
Thanks snowman99. I am looking at your suggestion. The biggest problem that i seem to have with x-cart is that I chose to add Crystal Blue Skins. It completely changes x-cart's command syntax and variables. Programs, add-ons, mods etc that work for everyone else just does not work for us. I like the look but hate the consequences.

I'll post my findings.

Cheers.

carpeperdiem 03-22-2007 07:26 AM

Re: IP Addresses in Users Online for all users
 
Works great in 4.1.6 - altough there are some very minor code changes -- it's very easy to figure it out... don't replace the entire block of code, just find the differences and use the 1 or 2 new lines.

Also, if you want to make the IP clickable, use this code instead of "IP:{$v.session_ip}"

Code:

&nbsp;IP: <a href="http://www.dnsstuff.com/tools/whois.ch?ip={$v.session_ip}&cache=off" target="_blank">{$v.session_ip}</a>

herbj 03-22-2007 11:19 AM

Re: IP Addresses in Users Online for all users
 
I have this working in 4.0.19. The only thing I do not understand is that I have 2 entries for each visitor.
1 shows the IP and the other does not.

Any Suggestions.

Oh. This originally did not work for me but then I realized I had missed a piece of code that belongs in the "auth.php" file. (in red) Hope this helps...

[code}
if(!empty($active_modules['Users_online'])) {
x_session_register("session_ip");
x_session_register("current_url_page");
x_session_register("current_date");
x_session_register("session_create_date");
$current_url_page = $php_url['url'].($php_url['query_string']?"?".$php_url['query_string']:"");
if(empty($session_create_date))
$session_create_date = time();
$current_date = time();
$session_ip = getenv('REMOTE_ADDR');
}
[/code}

josebueso 03-23-2007 10:56 AM

Re: IP Addresses in Users Online for all users
 
Quote:

Originally Posted by carpeperdiem
Works great in 4.1.6 - altough there are some very minor code changes -- it's very easy to figure it out... don't replace the entire block of code, just find the differences and use the 1 or 2 new lines.

Also, if you want to make the IP clickable, use this code instead of "IP:{$v.session_ip}"

Code:

&nbsp;IP: <a href="http://www.dnsstuff.com/tools/whois.ch?ip={$v.session_ip}&cache=off" target="_blank">{$v.session_ip}</a>


I used this code without any issue but I wanted to add the the code to make it clickable it worked for some time than I get page not found error. Was my IP banned after a few test clicks? or is their site is down? ( This program cannot display the webpage

Most likely causes:
You are not connected to the Internet.
The website is encountering problems.
There might be a typing error in the address.

What you can try:
Check your Internet connection. Try visiting another website to make sure you are connected)

Any help please

Jose

sindifizer 03-25-2007 02:12 PM

Re: IP Addresses in Users Online for all users
 
all i can say is wow

thanks a ton, this was something i have been dreaming about

now all i have to do is figure out where exactly to insert the code that allows you to click to do a locate ip

again, thanks. love it.

herbj 03-26-2007 09:01 AM

Re: IP Addresses in Users Online for all users
 
Quote:

Originally Posted by sindifizer
all i can say is wow

thanks a ton, this was something i have been dreaming about

now all i have to do is figure out where exactly to insert the code that allows you to click to do a locate ip

again, thanks. love it.



Use this code:
Code:

&nbsp;IP: <a href="http://www.dnsstuff.com/tools/whois.ch?ip={$v.session_ip}&cache=off" target="_blank">{$v.session_ip}</a>

Code goes in"skin1>modules>Users_online>stats.tpl" and replaces
Code:

"IP:{$v.session_ip}"

At least that is what worked for me!

Save your files before changing any code!

Good Luck!

herbj 03-28-2007 01:24 PM

Re: IP Addresses in Users Online for all users
 
Quote:

Originally Posted by herbj
I have this working in 4.0.19. The only thing I do not understand is that I have 2 entries for each visitor.
1 shows the IP and the other does not.



I figured this out and corrected it.

Works Great!

robertswww 03-28-2007 01:41 PM

Re: IP Addresses in Users Online for all users
 
Hi Herbj,

Glad to hear you figured the code out for X-cart 4.0.19 and fixed your duplicate entries problem.

If you could post your final, revised code, that would be great!

Thanks,

Robert


All times are GMT -8. The time now is 01:50 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.