| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | Mark Forums Read | User manuals | Login |
IP Addresses in Users Online for all users | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
IP Addresses in Users Online for all users
With this mod you can see the IP Address of all users (including "Unregistered User") in the Users Online page.
I've only tested this mod with v4.0.14, but it should work just as well in 4.0.x. It's really easy to implement this modification, but remember to backup your files before you make any changes. What the following changes do is: 1. Creates a new entry in session data called session_ip 2. Saves users IP address in session_ip 3. Calls session_ip data in the .tpl file You have to change 3 files: 1. auth.php 2. xcart>modules>Users_online>stats.php 3. xcart>skin1>modules>Users_online>stats.tpl On (or around) line 64 in auth.php look for: Code:
Then on line 50 in xcart>modules>Users_online>stats.php look for: Code:
In the same file (stats.php), look for the following on line 94: Code:
And finally you have to put "IP: {$v.session_ip}" into xcart>skin1>modules>Users_online>stats.tpl On line 20 look for: Code:
That's all the changes done, now go to the Users Online section [in Admin>Statistics>Users Online] and the IP Address of customers currently on your site should appear underneath their names. If you reload your Users Online page at regular intervals you can watch how your customers navigate your site. |
|||||||
#2
|
|||||||
|
|||||||
Nice, lots of people have asked for this. Thanks for sharing!
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
Thanks balinor, yeah I hope it helps a few people out.
I was really disappointed when I realised that xcart didnt have this functionality - I thought it was part of the standard package. OSCommerce has this feature as standard, and in my opinion it should be standard in xcart too. I think it's quite a valuable feature because it allows to you track your customers as they move around. In my experience at least, I find that most customers are unregistered until they are actually ready to buy something, at which point they will register. So for the majority of users on the site you dont really get any valuable insight into what they're doing - all you see is that 'someone' is on 'a particular page'. And if you have a lot of unregistered users on your site there is no way of keeping track of a specific user. Whereas when you can see their ip adress, the unregistered user loses some of their anonymity, so now you can see that user-1 was on the home page, now they've gone to cat-x, then product-y etc. So you are seeing the movements of your potential customers almost as it happens. Watching customers as they surf your site and buy (or not buy) in this way can help you lotate bottlenecks or problems in your site to help streamline the buying process that you have implemented. Incidentally, I also added another feature to this mod which displays the previous page the customer was on before they arrived at the current page. If anyone's interested I'll post that mod as well. |
|||||||
#4
|
|||||||||
|
|||||||||
good. Thanx for sharing...
__________________
Dongan MercuryMinds Technologies Professional X-Cart Design, X-Cart Development, X-Cart Customization Services www.mercuryminds.com Follow us at Facebook / Twitter |
|||||||||
#5
|
|||||||||
|
|||||||||
thanx great! but not working for me .14.
i didt the 3 steps login to my site but i dont see any ip's all is blank! extra extra extra is it possible to see the referral information? thank you! also can you post that mod too
__________________
// x-cart 4.1.9 X-CART CSS SKIN XC SEO IP Addresses in Users Online for all users Color coded order status |
|||||||||
#6
|
|||||||
|
|||||||
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? |
|||||||
#7
|
|||||||||
|
|||||||||
dear hamid,
well i tried $session_ip = $HTTP_SERVER_VARS['REMOTE_ADDR']; didn't solve it i can not see the ip's i can not understand if this is working for you not working for me.
__________________
// x-cart 4.1.9 X-CART CSS SKIN XC SEO IP Addresses in Users Online for all users Color coded order status |
|||||||||
#8
|
|||||||||
|
|||||||||
I could not find the correspondence code under those two files:
1. Auth.php 2. Users onine>stats.php Not sure because of the version or...?
__________________
_____________ Capture Your Mini-Me Look! - X-CART Gold (Current Version) V4.6 - Reboot - CDSEO |
|||||||||
#9
|
|||||||
|
|||||||
I am on 4.0.12 & I also can't find 2nd step code in stats.php
following is my stats.php Code:
Could you please me what excatly I will have to change in this file.
__________________
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 ---------------- |
|||||||
#10
|
|||||||
|
|||||||
Well, I had a look at an old x-cart distributive (v4.0.9), and it seems that x-cart changed stats.php slightly from 4.0.14 onwards (I think) - and you are right, the part of the code you need to change is not there.
I dont know enough about php to be able to tell you what to change to in your version of stats.php to get this mod to work - but I can suggest a couple of things that you can try. First thing to try is, in Users_online> stats.php - forget about the first part of the mod for that file, and just apply the second part of the mod instead, ie: Find: Code:
Change all the other files according to the instructions for the rest of the mod, upload, clear templates cache, and test to see if that works. If that doesn't work, then the only thing I can suggest is you could try to replace your stats.php with the modified one from 4.0.14 and see if that works. So change your stats.php file to this: Code:
To be honest, if the first method (above) didn't work, then I wouldn't have high hopes that this latter method will work, but it's definitely worth a try - just make sure you have a backup of your files in case it doesn't work and you need to revert. To MythNReality: the code in auth.php is there in v4.0.9, so it should be there in 4.0.12 as well. Just search for 'Users_online' in your copy of auth.php - there is only one instance of it in the whole of the file, so the code you are looking for should be right there (unless you've modified your auth.php and somehow gotten rid of it - if you have an unmodified copy of auth.php do a search in that and see if it's there). I hope this helps! |
|||||||
|
|
Thread Tools | Search this Thread |
|
|
|
|||
X-Cart forums © 2001-2020
|