Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

IP Addresses in Users Online for all users

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #31  
Old 02-21-2007, 12:01 PM
 
laurieblake laurieblake is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Sydney, AUS.
Posts: 56
 

Default 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
__________________
Gold Version 4.1.5
Crystal Blue Skins
Reply With Quote
  #32  
Old 03-09-2007, 11:18 AM
 
snowman99 snowman99 is offline
 

Member
  
Join Date: Feb 2007
Posts: 21
 

Default 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.
__________________
X-cart Ver: 4.7.10 (Linux/Apache)
XCartMods Ultra Template
BCSE Authorize DPM Module
CDSEO 2.2.0
CDSEO Pro Admin
Reply With Quote
  #33  
Old 03-09-2007, 03:46 PM
 
laurieblake laurieblake is offline
 

Advanced Member
  
Join Date: Jul 2006
Location: Sydney, AUS.
Posts: 56
 

Default 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.
__________________
Gold Version 4.1.5
Crystal Blue Skins
Reply With Quote
  #34  
Old 03-22-2007, 07:26 AM
 
carpeperdiem carpeperdiem is offline
 

X-Guru
  
Join Date: Jul 2006
Location: New York City, USA
Posts: 5,399
 

Default 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>
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #35  
Old 03-22-2007, 11:19 AM
  herbj's Avatar 
herbj herbj is offline
 

Advanced Member
  
Join Date: Feb 2007
Location: Florida
Posts: 62
 

Default 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}
Reply With Quote
  #36  
Old 03-23-2007, 10:56 AM
 
josebueso josebueso is offline
 

eXpert
  
Join Date: Apr 2006
Location: USA
Posts: 371
 

Default 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
__________________
Saul
x-cart 4.7.9 Gold Plus

www.uncionmusic.com
Reply With Quote
  #37  
Old 03-25-2007, 02:12 PM
  sindifizer's Avatar 
sindifizer sindifizer is offline
 

Member
  
Join Date: Mar 2007
Posts: 21
 

Thumbs up 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.
__________________
sindifizer
www.forbiddenreef.com
X-Cart version 4.1.6
Reply With Quote
  #38  
Old 03-26-2007, 09:01 AM
  herbj's Avatar 
herbj herbj is offline
 

Advanced Member
  
Join Date: Feb 2007
Location: Florida
Posts: 62
 

Default 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!
Reply With Quote
  #39  
Old 03-28-2007, 01:24 PM
  herbj's Avatar 
herbj herbj is offline
 

Advanced Member
  
Join Date: Feb 2007
Location: Florida
Posts: 62
 

Default 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!
Reply With Quote
  #40  
Old 03-28-2007, 01:41 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default 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
__________________
X-cart 4.1.10
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 10:13 AM.

   

 
X-Cart forums © 2001-2020