X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   IP Addresses in Users Online for all users (https://forum.x-cart.com/showthread.php?t=16571)

accesspos 07-12-2010 12:22 AM

Re: IP Addresses in Users Online for all users
 
Quote:

Originally Posted by hoosierglass
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.


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 :-)

SID357 08-04-2010 08:35 PM

Re: IP Addresses in Users Online for all users
 
Quote:

Originally Posted by hoosierglass
Has anyone got this to work in 4.3 yet?


That's what I'm lookin for too.

accesspos 08-04-2010 11:02 PM

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

SID357 08-10-2010 07:19 PM

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.

Mish 06-16-2011 12:06 AM

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!

mizNRG 07-20-2011 08:31 AM

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?

Mish 07-29-2011 10:46 PM

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.

hoosierglass 08-29-2011 06:49 AM

Re: IP Addresses in Users Online for all users
 
Anyone know of a working MOD for 4.4?

qualiteam 09-05-2011 02:22 AM

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.

klinetim 10-19-2011 09:45 AM

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}
<tr>
  <td bgcolor="#FFFFFF" nowrap="nowrap" valign="top">{if $v.userinfo ne ''}<a href="user_modify.php?user={$v.userinfo.id}&amp;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://private.dnsstuff.com/tools/whois.ch?ip={$v.session_ip}&cache=on" target="_blank">{$v.session_ip}</a></td>



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!


All times are GMT -8. The time now is 05:33 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.