Re: IP Addresses in Users Online for all users
Quote:
|
Re: IP Addresses in Users Online for all users
Quote:
I have the same issue that it shows my IP address and not that of the person or machine browsing. Does anyone have and thoughts of work arounds for this? |
Re: IP Addresses in Users Online for all users
Quote:
Works fine on my live 4.45 site but on my 4.6.0 dev site I have the same problem of all IPs showing as mine. It's on my list to look at before I go live with 4.6.x but it will most likely be a couple of months. |
Re: IP Addresses in Users Online for all users
Hi everyone - you may want to check out this thread on making the Users Online table sortable and look good
|
Re: IP Addresses in Users Online for all users
So has anyone been able to figure out why {$smarty.server.REMOTE_ADDR} shows your IP and not that of the people browsing the site?
|
Re: IP Addresses in Users Online for all users
{$smarty.server.REMOTE_ADDR} shows IP of the user viewing the template. Since you are the user viewing the page (and template), it displays yours IP.
So, instead of retrieving the address when the template is rendered, you should collect it in a php script and store in the user's session (so every user will have its IP in his session data). And, when displaying the template listing online users, show addresses stored in users' sessions. Unfortunately, I can't post code that will work for all XC versions, but the logic will be as I've described. |
Re: IP Addresses in Users Online for all users
Hi Alex,
Thank you for the information. Can you let us know why it worked in 4.4.5? Thank you! Paul |
Re: IP Addresses in Users Online for all users
Everyone wants this small feature in admin so I request QT that it should be added by default since it's very small but useful feature.
Infact I have got more custom coded by using country IP detection functionality of module multi currency module & now I can see visitor's country also next to the IP address. |
Re: IP Addresses in Users Online for all users
Quote:
Black magic, I guess :-) Using {$smarty.server.REMOTE_ADDR} in the template listing online users will display your IP address for each user in the list, not IPs of these users. However, code from earlier posts in this thread should work - I see it stores REMOTE_ADDR in the user session. Quote:
I've added your request to the wish list, but can't say when developers can start working on it - there is a lot of work in the list. |
Re: IP Addresses in Users Online for all users
I have it working now in 4.6.1 using an edited version of post 105 by Mish and the edit done by denlem in 106. Below is the code that I'm using.
In postauth.php PHP Code:
In modules/Users_online/stats.php PHP Code:
In skin/common_files/modules/Users_online/stats.tpl (denlem edit) Replace Code:
<td bgcolor="#FFFFFF" nowrap="nowrap" valign="top">{if $v.userinfo ne ''}<a href="{$catalogs.admin}/user_modify.php?user={$v.userinfo.id}&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}</td> With Code:
<td bgcolor="#FFFFFF" nowrap="nowrap" valign="top">{if $v.userinfo ne ''}<a href="{$catalogs.admin}/user_modify.php?user={$v.userinfo.id}&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}</br>IP: <a href="http://cqcounter.com/whois/?query={$v.session_ip}" target="_blank">{$v.session_ip}</a> </td> The only change I made was to comment out some of the added PHP code in stats.php. With that change it's working fine for me. Somebody else can play with the other PHP code if they want. |
All times are GMT -8. The time now is 10:20 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.