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)

neroag 03-16-2009 09:07 AM

Re: IP Addresses in Users Online for all users
 
For 4.2.0 i use the following ..

In postauth.php find ..
Code:

if (!empty($active_modules['Users_online'])) {
        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();

$session_ip = getenv('REMOTE_ADDR');
}


change to ..
Code:

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');
}


in modules/Users_online/stats.php find ...
Code:

        $rec['session_create_date'] = $data['session_create_date']+$config["Appearance"]["timezone_offset"];
        $statistics[] = $rec;


change to ..
Code:

        $rec['session_create_date'] = $data['session_create_date']+$config["Appearance"]["timezone_offset"];
        $rec['session_ip'] = $data['session_ip'];
        $statistics[] = $rec;


in skin1/modules/Users_online/stats.tpl find ..
Code:

<td bgcolor="#FFFFFF" nowrap="nowrap" valign="top">{if $v.userinfo ne ''}<a href="user_modify.php?user={$v.userinfo.login|escape:"url"}&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>

change to ..

Code:

<td bgcolor="#FFFFFF" nowrap="nowrap" valign="top">{if $v.userinfo ne ''}<a href="user_modify.php?user={$v.userinfo.login|escape:"url"}&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>

Stizerg 05-27-2009 04:55 AM

Re: IP Addresses in Users Online for all users
 
Works without modifications.
Thanks.

hoosierglass 06-10-2009 09:13 AM

Re: IP Addresses in Users Online for all users
 
Is there a way in the stats.tpl to get it to order the list of users online by time of last activity?

gary02140 06-14-2009 06:21 AM

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

Originally Posted by Stizerg
Works without modifications.
Thanks.



Stizerg,

Do you mean the mod works with your v4.1.12?

I am using V4.1.12 crystal blue. Does anyone here have successful experience in integrating this mod into the crystal blue?

In addition, I tried to show users online in admin side only by following a code modification from elsewhere, like

{if $active_modules.Users_online && $usertype ne "C"}
{include file="modules/Users_online/menu_users_online.tpl"}
{/if}

But the above code is the same to the original. And the users online is still shown on the customer side. Very frustrated. Why the v4.1.12 crystal blue is different from other skins?

Can anyone help me out? Many thanks in advance.

Stizerg 06-14-2009 06:13 PM

Re: IP Addresses in Users Online for all users
 
gary02140
Yes. version 4.1.12

If you want to remove users online from customer side you need to edit customer/home.tpl

gary02140 06-14-2009 07:38 PM

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

Originally Posted by Stizerg
gary02140
Yes. version 4.1.12

If you want to remove users online from customer side you need to edit customer/home.tpl


Stizerg,

Thanks! I comment it out and users online is removed from store front. Is this what you did?

Gary

donmck 06-16-2009 09:23 PM

Re: IP Addresses in Users Online for all users
 
I notice dnsstuff just locked out non-members in the last few days.
Anyone come across another dns lookup engine that can be integrated into this mod?

thanks in advance,

Cheers Don...

denlem 06-17-2009 05:59 AM

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

Originally Posted by donmck
I notice dnsstuff just locked out non-members in the last few days.
Anyone come across another dns lookup engine that can be integrated into this mod?

thanks in advance,

Cheers Don...


Find this in your stats.tpl

Code:


http://www.dnsstuff.com/tools/whois.ch?ip=


and change it to:

Code:


http://www.dnsstuff.com/tools/ipall/?tool_id=67&token=&toolhandler_redirect=0&ip=


It's working for me so far and it also gives you a google map with the location!

donmck 06-17-2009 11:47 AM

Re: IP Addresses in Users Online for all users
 
as advertised. very nice.
where do I sent the check :-)

Cheers Don...

gary02140 06-19-2009 04:08 PM

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

Originally Posted by donmck
I notice dnsstuff just locked out non-members in the last few days.
Anyone come across another dns lookup engine that can be integrated into this mod?

thanks in advance,

Cheers Don...


In case that this dnsstuff is not available in the future, http://www.netip.de/ can be a good option. But I just don't know how to code it into the mod. Can someone here figure it out?


All times are GMT -8. The time now is 08:25 PM.

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