Re: IP Addresses in Users Online for all users
Has anyone got this to work in 4.3 yet?
|
Re: IP Addresses in Users Online for all users
did anyone tried it with 4.2?
thank you for your help |
Re: IP Addresses in Users Online for all users
I think post #61 works for 4.2
|
Re: IP Addresses in Users Online for all users
find it and will try tomorrow.
thank you |
Re: IP Addresses in Users Online for all users
Quote:
I did try all 3(?) different "Look-up" URL's. Didn't work. |
Re: IP Addresses in Users Online for all users
Working in 4.22
Show IP. After click on IP show dnsstuff page. thank you. |
Re: IP Addresses in Users Online for all users
I also did not find exact code in postauth.php but edit my with lines of code that are missing and added if statement.
And it work. I do not see any errors so I assume it implement it right. Thank you again. So part for my postauth.php now look like this (lines 78 to 97): 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'); } # # Display # |
Re: IP Addresses in Users Online for all users
I tried to apply the code and I can still see the User online from the customers end. I don't want people to be able to see who or how many are online, is there something I am missing?
Many Thanks, Quote:
|
Re: IP Addresses in Users Online for all users
The portion of users online mentioned here is in regards to the admin side. If you want to remove it from the customer side you will need to comment it out from the home.tpl file in the footer div.
|
Re: IP Addresses in Users Online for all users
OH!!!!!!!!! Thank you so much!! I am sorry I am just working too many hours on this website, not knowing what I am doing and my eyes are going crossed with all the reading I am doing.
I might also be getting my posts crossed! Many thanks my friend!! Felicia Quote:
|
Re: IP Addresses in Users Online for all users
Quote:
I tried doing the following: <div id="footer"> {* {if $active_modules.Users_online} {include file="modules/Users_online/menu_users_online.tpl"} {/if} *} {include file="customer/bottom.tpl"} </div> Which removes the users online information on the customer side but the space available for users online info still remained. the info within bottom.tpl moved up leaving a "blank" area at the bottom of the page. I was hoping to remove the users online info from the customer side as if it were not selected within admin,,,including the space for it. any ideas :-) |
Re: IP Addresses in Users Online for all users
Quote:
That's what I'm lookin for too. |
Re: IP Addresses in Users Online for all users
IN SKIN1/CUSTOMER/HOME.TPL
<div id="footer"> {* remove users online info on customer side - start {if $active_modules.Users_online} {include file="modules/Users_online/menu_users_online.tpl"} {/if} # remove users online info on customer side - end *} {include file="customer/bottom.tpl"} </div> IN MAIN.CSS /* users online module */ /* users statistics box */ /* remove users online from customer start .uo-box { width: 100%; border-top: 1px solid #acb7c7; background-color: #e8edf4; padding: 10px 0px 10px 13px; } remove users online from customer end */ AND /* users online sublayout */ /* remove users online from customer start .uo-container #content-container { padding-bottom: 104px; } .uo-container #footer { height: 94px; } .normal { font-weight: normal; } remove users online from customer end */ The above will remove users online from customer side |
Re: IP Addresses in Users Online for all users
Haven't been able to get this to work on 4.3.2. Basically trying to get the IP listed of who's on the customer site via admin panel, but so far no luck.
|
Re: IP Addresses in Users Online for all users
G'day,
I modified the code to resolve the hostname (from the IP address) instead of having a hyperlink to resolve it. Give it a try: Follow the steps previously provided. Then do the following: Then on or around line 94 in xcart>modules>Users_online>stats.php look for you recently changed code: Code: *********************************************** $rec['session_create_date'] = $data['session_create_date']+$config["General"]["timezone_offset"]; $rec['session_ip'] = $data['session_ip']; $statistics[] = $rec; *********************************************** and change it to *********************************************** $rec['session_create_date'] = $data['session_create_date']+$config["General"]["timezone_offset"]; if (!empty($data['session_ip'])) { if ($HTTP_SERVER_VARS['REMOTE_ADDR'] != $data['session_ip']) $rec['session_ip'] = gethostbyaddr($data['session_ip']); else $rec['session_ip'] = "Admin"; } else $rec['session_ip'] = $data['session_ip']; $statistics[] = $rec; *********************************************** This will: If it can resolve the IP Address, it will and replace the IP address with the hostname. If it was from your IP address it will replace it with ADMIN. If it cannot resolve, it will leave the IP address there. Here is an example from my site: Unregistered customer IP: Admin Unregistered customer IP: static-208-80-194-33.as13448.com Please note if your first line in that code looks like: $rec['session_create_date'] = $data['session_create_date']+$config["Appearance"]["timezone_offset"]; then keep it that way! |
Re: IP Addresses in Users Online for all users
I used this mod and it works fine. My only issue is that it lists everyone as "Unregistered" even though some are registered. Is this an issue with the mod or with XCart in general?
|
Re: IP Addresses in Users Online for all users
G'day mate,
Sorry but I don't have the same problem. . Double check what you did in xcart>skin1>modules>Users_online>stats.tpl You may have made an error there. |
Re: IP Addresses in Users Online for all users
Anyone know of a working MOD for 4.4?
|
Re: IP Addresses in Users Online for all users
1 Attachment(s)
I've attached the "IP Addresses in Users Online for all users" mod patch for 4.4.x.
It can be applied via the Patch/Upgrade section. |
Re: IP Addresses in Users Online for all users
Hello,
We're using the Users_Online Module in version 4.4.1, and all of our online customers are listed as "Unregistered Customer", even though they are logged in. I'm still fairly new to the code, but I think I tracked it down to here: >skin>common_files>modules>Users_online>stats.tp l starting at my line 21 Code:
{foreach from=$statistics item=v} For some reason, our $v.userinfo array is always empty, so the {if} statement always defaults to the $lng.lbl_unregistered_customer value. Any ideas on what we could have wrong that would cause that array to have no values? Thank you! |
Re: IP Addresses in Users Online for all users
Quote:
I've applied this patch to a clean unmodified 4.4.2 installation. I get the following error: Quote:
|
Re: IP Addresses in Users Online for all users
This is not an error. It means XC cannot auto patch the files, you need to do this manually
|
Re: IP Addresses in Users Online for all users
But this was on a clean, unmodified 4.4.2 install. If the patch won't apply, there's a problem with the patch or the patch software.
Edit: I did a manual patch. There was no reason that the patch should have failed on the first and third file and the patch was incorrectly applied on the second file. Manually patched it now works ok. |
Re: IP Addresses in Users Online for all users
In 4.4.4 the patch is applied without any problems.
Probably there were some updates in the patching system since 4.4.2... |
Re: IP Addresses in Users Online for all users
Hi Folks,
I've manually changed Version 4.4.5 to display IP Addresses / domain lookup for users online:
Code:
if (!empty($active_modules['Users_online'])) { to Code:
if (!empty($active_modules['Users_online'])) { Open Xcart -> Modules -> Users_online->stats.php Edit line 104 and change Code:
$rec['session_create_date'] = $data['session_create_date'] + $config["Appearance"]["timezone_offset"]; to Code:
$rec['session_create_date'] = $data['session_create_date'] + $config["Appearance"]["timezone_offset"]; Open x-cart -> skin1 -> Modules -> Users_online->stats.tpl (Note, on my site I had to use X-cart ->Skin instead of skin1) Edit line 23 Change it from 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> 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} IP: {$v.session_ip} <a href="http://cqcounter.com/whois/?query={$v.session_ip}" target="_blank">Trace Location</a> </td> Here is a screen shot: http://mojoimage.com/free-image-hosting-11/3523Screen-Shot-2012-08-06-at-3-26-39-PM.pngFree Image Hosting |
Re: IP Addresses in Users Online for all users
I just installed this update 4.5.2 and it works there also.
The only difference is the section below is in a slightly different location and can be found in: X-Cart/skin/common_files/modules/Users_online/stats.tpl Quote:
I also edited the change to the following: Code:
This cleans it up a bit and puts the "IP: " on it's own line, and the Trace Location link is dropped and the IP is clickable instead. http://backwoodstattoos.com/images/P/ip.png |
Re: IP Addresses in Users Online for all users
Will this still work on 4.5.4? Do I just need to do what is in posts 105 and 106? Sometimes these old threads where people add on to and modify the code are tough to stumble upon later because you don't know how far back you have to start reading.
|
Re: IP Addresses in Users Online for all users
It's not working on my 4.5.5 dev site. {$v.session_ip} does not have a value. It's on my list to look at but may be above my pay grade :-)
|
Re: IP Addresses in Users Online for all users
For 4.5.5 (not tested in other versions)
I used the Smarty function {$smarty.server.REMOTE_ADDR} so I don't need to make any changes to postauth.php or stats.php anymore. In store/skin/common_files/modules/Users_online/stats.tpl Change From: Quote:
Quote:
|
Re: IP Addresses in Users Online for all users
I use IP2Location service, and when I make the change suggested,
Code:
IP: <a href="http://www.ip2location.com/{$v.session_ip}" target="_blank">{$v.session_ip}</a></td> changed to Code:
IP: <a href="http://www.ip2location.com/{$smarty.server.REMOTE_ADDR}" target="_blank">{$smarty.server.REMOTE_ADDR}</a></td> it always shows MY ip address, instead of the user's IP address. Am I missing something? |
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 12:26 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.