| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
IP In Admin Users Online for 4.3 | ||||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
IP In Admin Users Online for 4.3
I played around today and got this to work for me the same way it did in 4.1.12.
THIS CODE IS FOR 4.3.X in postauth.php below if (!defined('HTTPS_CHECK_SKIP')) { @include $xcart_dir.DIR_CUSTOMER."/https.php"; } change: PHP Code:
to: PHP Code:
In modules/Users_online/stats.php below: $rec['session_create_date'] = $data['session_create_date']+$config["Appearance"]["timezone_offset"]; insert: PHP Code:
In skin1/modules/Users_online/stats.tpl change: PHP Code:
to: PHP Code:
IPs will not appear until someone goes onto your website after you change the above codes. |
|||||||||
#2
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
Moving to Completed Custom Mods
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#3
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
Great work! I'll be using it for sure.
__________________
Best Wishes, James 4.5.2 Gold (work in progress) |
|||||||
#4
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
Thanks works well. Am tempted to actually link this code to another look-up and actually geo-locate the ip address and then pull back the country name and display that instead of the ip address, shouldnt be that tough...
__________________
Xcart 4.3.1 |
|||||||
#5
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
bionicfish: If you do, be sure to share!
__________________
Best Wishes, James 4.5.2 Gold (work in progress) |
|||||||
#6
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
silly ? but would this be the same in 4.2.2?
|
|||||||
#7
|
|||||||||
|
|||||||||
Re: IP In Admin Users Online for 4.3
You should have no problem in 4.2 as I used that as a template to get this to work.
Mike |
|||||||||
#8
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
where exactly in admin will this show up? will be super helpful to get this working, if i can!
this is what i show in postauth.php below if (!defined('HTTPS_CHECK_SKIP')) { @include $xcart_dir.DIR_CUSTOMER."/https.php"; } Quote:
so, would the replacement be the same or would it be a bit different?? thanks. |
|||||||
#9
|
|||||||||
|
|||||||||
Re: IP In Admin Users Online for 4.3
I don't see a problem with switching this out but to err on the side of caution make a back up of your original postauth.php file.
The will show up in stats/users online in the admin menu. |
|||||||||
#10
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
Quote:
I have mine working with a local table, but there are several services that let you pull from their geo location database for free. This is a simple one that I used, working in 4.3.2. Note that the source server adds a small delay to limit requests (unless you donate to them). Please backup your two files first in case you find the delay too long on your site. It took about 8 seconds to run "Users Online" for me, worthwhile to me, but my site might not be as large as most. Also, if someone wanted to change this code to keep each visitor's ip info in a cookie, this should reduce any delay to nothing. NOTE: These changes assume that you've already added the "session_ip" changes mentioned in this thread. In \modules\Users_online\stats.php, below: $rec['session_ip'] = $data['session_ip']; insert: PHP Code:
At the end of the same file, just before the closing: ?> insert: PHP Code:
In \skin1\modules\Users_online\stats.tpl, change: PHP Code:
to this: PHP Code:
That's it. The end result is you'll have the IP Address, a picture of the vistor's country flag and their city. Hovering the mouse shows their state/province and country name. NOTE: I've removed the {$lng.lbl_unregistered_customer} label. You may prefer to add it back if you find it useful. NOTE: You'll need to change the <img> path above to reflect where your flag images files are located. If I can figure out how to upload my flag files, I'll gladly do that. They are 16 pixel wide flag image files.
__________________
X-Cart 4.3.2 X-SpecialOffers |
|||||||
|
|||
X-Cart forums © 2001-2020
|