| ||||||||||
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 |
#11
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
If you'd like to use your own geo location table instead. You can download the SQL script from http://ipinfodb.com/ip_database.php. The advantage is speed and less code. The disadvantage is that you'll be responsible to update it.
I use the complete single city one. In \modules\Users_online\stats.php, change: $rec['session_ip'] = $data['session_ip']; to this: PHP Code:
Use the same template changes (to stats.tpl) shown in the previous above. That's it. Like the previous post, this will also show you the IP Address, flag of the visitor's country, and their city. Hover the city shows the province/state.
__________________
X-Cart 4.3.2 X-SpecialOffers |
|||||||
#12
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
I have actually put together a simliar bit of code, have been working on it for a while actually, just havent gotten around to posting yet as working on making it a bit more than just a hack but a proper solution.
A couple of chanllenges that I have had: - Retrieving from an online database can be slow (as you have seen) so I have done this with Ajax instead, loading the flags and geolocation, after the initial page load. - Most online services have a limit on the number of requests, so I cached the last 60 days ip geolocations locally, to reduce the lookups. - Lots of bots / spiders show up as "active users" therefore I have built some additional filters around these to remove them from the list Anyway... am happy to see others are thinking in the same way... when i get around to it I will post up the code for everybody, am thinking about doing this as an add-on module to make it more accessible to people who are not complete code monkeys! If anybody is interested in doing some beta testing PM me and once I have done the code a bit cleaner, I will send you a copy.
__________________
Xcart 4.3.1 |
|||||||
#13
|
|||||||
|
|||||||
Re: IP In Admin Users Online for 4.3
Any idea if this works on Pro? Tried Hoosiers original post, but couldn't get it to work.
thnx
__________________
Rance Ball 4.4.4 http://www.shirtsforthepeople.com/ http://www.handsonwebhosting.com/ |
|||||||
#14
|
|||||||||
|
|||||||||
Re: IP In Admin Users Online for 4.3
Thank you, hoosierglass, for sharing this code.
Post #1 works for V4.4.1 (except you need to remove one "}" after the: 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'); } } <---- remove !!!
__________________
_____________ Capture Your Mini-Me Look! - X-CART Gold (Current Version) V4.6 - Reboot - CDSEO |
|||||||||
#15
|
|||||||||
|
|||||||||
Re: IP In Admin Users Online for 4.3
would someone please help...where shall I place the downloaded "SQL script" file?
__________________
_____________ Capture Your Mini-Me Look! - X-CART Gold (Current Version) V4.6 - Reboot - CDSEO |
|||||||||
#16
|
|||||||||
|
|||||||||
Re: IP In Admin Users Online for 4.3
If anyone has a work around for this in version 4.4.3 I would love to hear about it. Everything I have tried crashes the site.
|
|||||||||
|
|||
X-Cart forums © 2001-2020
|