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
  #41  
Old 06-08-2007, 12:13 PM
  shopccp's Avatar 
shopccp shopccp is offline
 

Advanced Member
  
Join Date: Oct 2006
Posts: 35
 

Default Re: IP Addresses in Users Online for all users

Your mod does not work on my site either. I configured all three files...no ip in users online. I'm using xcart 4.1.7.

This mod now works on my site. After I posted the above message, refresh all browser and ftp content...minutes later the ip address shows up in users online. I noticed my ip address is not listed in user online stats when I'm connected to the homepage. Its a little wierd, but at least other ip addresses shows up.


Justin

Quote:
Originally Posted by hamid
Hi 2019

It's a shame that it's not working for you - but if you have followed the instructions above and you are running 4.0.14 (although it probably works on any 4.0.x), then I really don't know why it's not working without seeing your code.

This was the first mod I've posted, so to be honest I dont know if it works on anyone elses system. It works on mine, so in theory it should work with others too.

I'm not an expert, but in order to try to make it work you could try the following:

1. Some servers have a problem with the 'getenv' function, so in my modification of auth.php, change

$session_ip = getenv('REMOTE_ADDR');

to:

$session_ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];

Then upload the ammended file and see if the IP addresses appear in your Users Online page.

To be honest, I think it's generally accepted that it's better practice to use $HTTP_SERVER_VARS rather than getenv anyway

If anyone else has tried this mod... did it work?
__________________
X-Cart Gold v4.4.4
Apache v2.2.20
PHP v5.3.8
MySQL v5.1.56-log
Linux kernel v2.6.18-238.19.1.el5xen
Reply With Quote
  #42  
Old 06-09-2007, 09:35 PM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Question Re: IP Addresses in Users Online for all users

Hello,
Now any one can please paste the perfect working code here which tested in 4.1.7 also.
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #43  
Old 06-15-2007, 08:57 AM
 
keystone keystone is offline
 

X-Adept
  
Join Date: Jul 2006
Location: USA
Posts: 787
 

Default Re: IP Addresses in Users Online for all users

Hi,
I have changed my code and my users online stats are showing ip addresses but can someone explain this? All the IP addresses shown are the same. What is going on? I have between 40 and 60 unregistered users shown but all have the same IP address. The First entry and Last entry are always the same time as eachother.

Customer Date Current page Cart content
First entry Last entry
Unregistered customer IP: 38.99.44.106 15-06-2007
11:48:11 15-06-2007
11:48:11 .../home.php?cat=10&sort=title&sort_direction=0&page=2 5
Unregistered customer IP: 38.99.44.106 15-06-2007
11:48:20 15-06-2007
11:48:20 .../product.php?printable=Y&productid=2423&cat=12&page =7
Unregistered customer IP: 38.99.44.106 15-06-2007
11:49:09 15-06-2007
11:49:09 .../product.php?printable=Y&productid=3426&cat=9&page= 4&js=n
Unregistered customer IP: 38.99.44.106 15-06-2007
11:11:07 15-06-2007
11:11:07 .../product.php?productid=2415&js=y
Unregistered customer IP: 38.99.44.106 15-06-2007
11:08:52 15-06-2007
11:08:52 .../product.php?printable=Y&productid=673
Unregistered customer IP: 38.99.44.106 15-06-2007
11:08:26 15-06-2007
11:08:26 .../product.php?productid=196&cat=8&page=1&js=n
Unregistered customer IP: 38.99.44.106 15-06-2007
11:09:08 15-06-2007
11:09:08 .../product.php?printable=Y&productid=3425
Unregistered customer IP: 38.99.44.106 15-06-2007
11:30:38 15-06-2007
11:30:38 .../product.php?printable=Y&productid=4805
Unregistered customer IP: 38.99.44.106 15-06-2007
11:30:58 15-06-2007
11:30:58 .../product.php?productid=140&cat=8&page=5
Unregistered customer IP: 38.99.44.106 15-06-2007
11:31:04 15-06-2007
11:31:04 .../product.php?productid=10815&js=n
Unregistered customer IP: 38.99.44.106 15-06-2007
11:27:14 15-06-2007
11:27:14 .../product.php?productid=6611&js=y
Unregistered customer IP: 38.99.44.106 15-06-2007
11:27:54 15-06-2007
11:27:54 .../product.php?productid=3005&cat=12&page=2&js=y
Unregistered customer IP: 38.99.44.106 15-06-2007
11:05:57 15-06-2007
11:05:57 .../product.php?productid=810&js=y
Unregistered customer IP: 38.99.44.106 15-06-2007
10:52:28 15-06-2007
10:52:28 .../product.php?printable=Y&productid=11507&cat=17&pag e=1
Unregistered customer IP: 38.99.44.106 15-06-2007
10:53:07 15-06-2007
10:53:07 .../product.php?productid=4427&cat=7&page=10&js=y
__________________
www.uscandleco.com - X-Cart Version 4.7.11 Gold Plus php7.3
mods:
reCaptcha
running on UNIX

www.keystonecandle.com X-Cart Gold Plus - Version 4.7.11 php7.2
mods:
reCaptcha
cdseo pro
running on UNIX
Reply With Quote
  #44  
Old 06-16-2007, 06:21 PM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

Default Re: IP Addresses in Users Online for all users

Quote:
Originally Posted by keystone
Hi,
I have changed my code and my users online stats are showing ip addresses but can someone explain this? All the IP addresses shown are the same. What is going on?

Don't worry...it sems the bots are crawling your site & I have marked that for some reason they like to crwal "printable page" more as its pure HTML.
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote
  #45  
Old 06-22-2007, 07:15 PM
 
ACS ACS is offline
 

Newbie
  
Join Date: May 2006
Posts: 7
 

Red face 4.1.6 IP address online

Apologise in advance if i am not posting right, first time.
I found a thread on modifiying xcart so you can see user IP addresses online. This thread is quite old and for an earlier version.

http://forum.x-cart.com/showthread.php?t=16571&highlight=ip+addresses+onli ne

I have x-cart version 4.1.6 and the files are different and being such a novice I can't work out which ones to change. The x-cart guys want 60 points to modify this for me. can anyone out there update the above thread to newer versions of x-cart? I would really apreciate your help.
__________________
ACS
Xcart gold
V4.1.6
Reply With Quote
  #46  
Old 06-22-2007, 07:48 PM
 
carpeperdiem carpeperdiem is offline
 

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

Default Re: 4.1.6 IP address online

The mod you linked to works fine in 4.1.6, 4.1.7 and 4.1.8

You should not start a new thread... I am appending this to the thread you are linking to.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #47  
Old 06-22-2007, 08:05 PM
 
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

PS -- post#1 works in 4.1.x -- but be careful -- the first line of the php code should have a space after the if, like this:

Code:
if(!empty($active_modules['Users_online'])) {

also, in the template, respect xhtml conventions.
__________________
xcart 4.5.4 gold+ w/x-payments 1.0.6; xcart gold 4.4.4
Reply With Quote
  #48  
Old 07-06-2007, 03:46 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: IP Addresses in Users Online for all users

I integrated this mod into my 4.0.19 site today. Working wonderfully.

A few notes...

When you first upload the 3 mod files, you may have some empty IP fields at first, from the visitor's that were already on your site. As new visitors enter and move around all the empty IP fields will become filled in, so this symptom is short lived, but may mislead some to think the mod isn't working when they first install it.


---
In Auth.php:

$session_ip = getenv('REMOTE_ADDR');
or
$session_ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];

Both of the above seemed to work fine on my site, for now, I'm sticking with the first one.


---
Stats.php:

My site code was a bit different for the 2nd mod in this file, but it worked fine by inserting it at the end of this section of code (just above $statistics[] = $rec):

Code:
$rec['current_date'] = $data['current_date']+$config["General"]["timezone_offset"]; $rec['current_url_page'] = $data['current_url_page']; $rec['session_create_date'] = $data['session_create_date']+$config["General"]["timezone_offset"]; # NOTE - add session_ip line below... $rec['session_ip'] = $data['session_ip']; $statistics[] = $rec;

---
Stats.tpl:

In this file, I wanted the visitor's IP address to be displayed on a new line, just below where it typically says, "Unregistered customer", so I added a Break as follows:

Code:
<TD bgcolor="#FFFFFF" nowrap valign="top">{if $v.userinfo ne ''}<A href="user_modify.php?user={$v.userinfo.login|escape:"url"}&usertype=C">{$v.userinfo.firstname} {$v.userinfo.lastname}</A>{if $v.userinfo.status eq 'A'}<BR><I>({$lng.lbl_anonymous_customer})</I>{/if}{else}{$lng.lbl_unregistered_customer}{/if} {* NOTE - Add site visitor IP address to Statistics - Users Online page via line below *} <BR>IP: {$v.session_ip} </TD>

Hamid, Thanks for this helpful mod!

Robert
__________________
X-cart 4.1.10
Reply With Quote
  #49  
Old 07-07-2007, 07:34 AM
 
jchopick jchopick is offline
 

Member
  
Join Date: Aug 2006
Posts: 16
 

Default Re: IP Addresses in Users Online for all users

Hamid,

Thank you for this mod it works great. I made the small change of

$session_ip = getenv('REMOTE_ADDR');
to
$session_ip = $HTTP_SERVER_VARS['REMOTE_ADDR'];

and it does what I was looking to do. Thanks again....

Jeff
__________________
Sakura Budokan Admin
X-Cart Gold Ver 4.1.11,Neon Lights, X-AOM, X-Survey, X-SpecialOffers, X-FancyCategories, X-Magnifier.
Reply With Quote
  #50  
Old 07-13-2007, 09:26 AM
 
Paul H Paul H is offline
 

eXpert
  
Join Date: Sep 2005
Posts: 246
 

Default Re: IP Addresses in Users Online for all users

I have this mod working on my site but it just displays the persons first name twice
and it would be better having the user name displayed-did i do something wrong here?
__________________
Xcart Gold 4.1.11-Gone
= 4.7.11-Live
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 08:45 AM.

   

 
X-Cart forums © 2001-2020