Re: IP Addresses in Users Online for all users
Your mod does not work on my site either. I configured all three files...no ip in users online. I'm using xcart 4.1.7.
This mod now works on my site. After I posted the above message, refresh all browser and ftp content...minutes later the ip address shows up in users online. I noticed my ip address is not listed in user online stats when I'm connected to the homepage. Its a little wierd, but at least other ip addresses shows up. Justin Quote:
|
Re: IP Addresses in Users Online for all users
Hello,
Now any one can please paste the perfect working code here which tested in 4.1.7 also. |
Re: IP Addresses in Users Online for all users
Hi,
I have changed my code and my users online stats are showing ip addresses but can someone explain this? All the IP addresses shown are the same. What is going on? I have between 40 and 60 unregistered users shown but all have the same IP address. The First entry and Last entry are always the same time as eachother. Customer Date Current page Cart content First entry Last entry Unregistered customer IP: 38.99.44.106 15-06-2007 11:48:11 15-06-2007 11:48:11 .../home.php?cat=10&sort=title&sort_direction=0&page=2 5 Unregistered customer IP: 38.99.44.106 15-06-2007 11:48:20 15-06-2007 11:48:20 .../product.php?printable=Y&productid=2423&cat=12&page =7 Unregistered customer IP: 38.99.44.106 15-06-2007 11:49:09 15-06-2007 11:49:09 .../product.php?printable=Y&productid=3426&cat=9&page= 4&js=n Unregistered customer IP: 38.99.44.106 15-06-2007 11:11:07 15-06-2007 11:11:07 .../product.php?productid=2415&js=y Unregistered customer IP: 38.99.44.106 15-06-2007 11:08:52 15-06-2007 11:08:52 .../product.php?printable=Y&productid=673 Unregistered customer IP: 38.99.44.106 15-06-2007 11:08:26 15-06-2007 11:08:26 .../product.php?productid=196&cat=8&page=1&js=n Unregistered customer IP: 38.99.44.106 15-06-2007 11:09:08 15-06-2007 11:09:08 .../product.php?printable=Y&productid=3425 Unregistered customer IP: 38.99.44.106 15-06-2007 11:30:38 15-06-2007 11:30:38 .../product.php?printable=Y&productid=4805 Unregistered customer IP: 38.99.44.106 15-06-2007 11:30:58 15-06-2007 11:30:58 .../product.php?productid=140&cat=8&page=5 Unregistered customer IP: 38.99.44.106 15-06-2007 11:31:04 15-06-2007 11:31:04 .../product.php?productid=10815&js=n Unregistered customer IP: 38.99.44.106 15-06-2007 11:27:14 15-06-2007 11:27:14 .../product.php?productid=6611&js=y Unregistered customer IP: 38.99.44.106 15-06-2007 11:27:54 15-06-2007 11:27:54 .../product.php?productid=3005&cat=12&page=2&js=y Unregistered customer IP: 38.99.44.106 15-06-2007 11:05:57 15-06-2007 11:05:57 .../product.php?productid=810&js=y Unregistered customer IP: 38.99.44.106 15-06-2007 10:52:28 15-06-2007 10:52:28 .../product.php?printable=Y&productid=11507&cat=17&pag e=1 Unregistered customer IP: 38.99.44.106 15-06-2007 10:53:07 15-06-2007 10:53:07 .../product.php?productid=4427&cat=7&page=10&js=y |
Re: IP Addresses in Users Online for all users
Quote:
Don't worry...it sems the bots are crawling your site & I have marked that for some reason they like to crwal "printable page" more as its pure HTML. |
4.1.6 IP address online
Apologise in advance if i am not posting right, first time.
I found a thread on modifiying xcart so you can see user IP addresses online. This thread is quite old and for an earlier version. http://forum.x-cart.com/showthread.php?t=16571&highlight=ip+addresses+onli ne I have x-cart version 4.1.6 and the files are different and being such a novice I can't work out which ones to change. The x-cart guys want 60 points to modify this for me. can anyone out there update the above thread to newer versions of x-cart? I would really apreciate your help. |
Re: 4.1.6 IP address online
The mod you linked to works fine in 4.1.6, 4.1.7 and 4.1.8
You should not start a new thread... I am appending this to the thread you are linking to. |
Re: IP Addresses in Users Online for all users
PS -- post#1 works in 4.1.x -- but be careful -- the first line of the php code should have a space after the if, like this:
Code:
if(!empty($active_modules['Users_online'])) { also, in the template, respect xhtml conventions. |
Re: IP Addresses in Users Online for all users
I integrated this mod into my 4.0.19 site today. Working wonderfully.
A few notes... When you first upload the 3 mod files, you may have some empty IP fields at first, from the visitor's that were already on your site. As new visitors enter and move around all the empty IP fields will become filled in, so this symptom is short lived, but may mislead some to think the mod isn't working when they first install it. --- In Auth.php: $session_ip = getenv('REMOTE_ADDR'); or $session_ip = $HTTP_SERVER_VARS['REMOTE_ADDR']; Both of the above seemed to work fine on my site, for now, I'm sticking with the first one. --- Stats.php: My site code was a bit different for the 2nd mod in this file, but it worked fine by inserting it at the end of this section of code (just above $statistics[] = $rec): Code:
$rec['current_date'] = $data['current_date']+$config["General"]["timezone_offset"]; --- Stats.tpl: In this file, I wanted the visitor's IP address to be displayed on a new line, just below where it typically says, "Unregistered customer", so I added a Break as follows: Code:
<TD bgcolor="#FFFFFF" 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} Hamid, Thanks for this helpful mod! Robert |
Re: IP Addresses in Users Online for all users
Hamid,
Thank you for this mod it works great. I made the small change of $session_ip = getenv('REMOTE_ADDR'); to $session_ip = $HTTP_SERVER_VARS['REMOTE_ADDR']; and it does what I was looking to do. Thanks again.... Jeff |
Re: IP Addresses in Users Online for all users
I have this mod working on my site but it just displays the persons first name twice
and it would be better having the user name displayed-did i do something wrong here? |
Re: IP Addresses in Users Online for all users
Quote:
in stats.tpl file find <TD bgcolor="#FFFFFF" nowrap valign="top">{if $v.userinfo ne ''}{$v.userinfo.firstname} {$v.userinfo.firstname}{if $v.userinfo.status eq 'A'} ({$lng.lbl_anonymous_customer}){/if}{else}{$lng.lbl_unregistered_customer}{/if}</TD> And replace it with: <TD bgcolor="#FFFFFF" nowrap valign="top">{if $v.userinfo ne ''}{$v.userinfo.firstname} {$v.userinfo.lastname}{if $v.userinfo.status eq 'A'} ({$lng.lbl_anonymous_customer}){/if}{else}{$lng.lbl_unregistered_customer}{/if}</TD> I guess above should resolve this problem. |
Re: IP Addresses in Users Online for all users
Yes that worked !
and for a shot in the dark I also tried adding {$v.userinfo.username} but that didn't work |
Re: IP Addresses in Users Online for all users
post#1 works with XCart 4-1-9! Sweet~
|
Re: IP Addresses in Users Online for all users
Quote:
|
Re: IP Addresses in Users Online for all users
I've made the changes to the php's ok.
But in the tpl, the line of code is completely different from the one quoted in the OP to look for. Quote:
Has there been an update that this mod has not taken into account since the last post on this thread ? Suggestions ? I dont like the idea of just replacing it, without knowing why the code is different. |
Re: IP Addresses in Users Online for all users
Ok, took the plunge and just added the IP bit to the existing line.
Seems to work fine. And I added the line break as well :) Next question : How does one modify this to only display 1 line per IP ? Edit : I got the click on IP working to, thanks whoever suggested the 2 add-ons. :) I'm finding the results a bit odd. All the IP's are the same, and yet the user environments are all different. If it was the same IP address, why isnt the environment list showing all the same ? Personally, I dont want to know that 1 user is on and has visited 61 pages in the last however long. I want to know how many genuine users are online now and where they actually are now. Can anyone suggest some modifications to achieve this ? |
Re: IP Addresses in Users Online for all users
hi circleofatlantis
Each time a user opens a new window, they will be assigned a new sessionid. So, say a user is on your home page and clicks one of your categories to open in a new window - they will now appear twice in your Users Online. So the more windows they open, the more times they will appear in your Users Online. Each session remains active for 1 hour by default. Obviously different people surf in different ways - some people always open up links in new windows - but you will find that most people keep to one session. In my experience, I have found that if you see many many instances of the same IP appearing multiple times, it's usually a spider (or other automated bot creature) indexing your site - but its badly written - ie. it hasn't been configured to keep the same session. I usually watch out for these as they can open hundreds of connections in a short amount of time which leads to an unneccesary heavy load on the server. When I spot these, I run a quick check to see where the ip originates from and then add a 'deny from xxx.xxx.xxx.xxx' in my .htaccess file to stop it in its tracks. There probably is a way of modifying the code to filter multiple instances of each ip address, but I have found that the original code is just too useful in its present form. |
Re: IP Addresses in Users Online for all users
Thanks for that info. Makes things make sense now :)
I've had one persistent robot in, which I traced to a site that says its an experimental robot. I asked for some details and they said it was for a yet to be announced search engine. No follow up details. I banned it from the site. My stats show its using more bandwidth than Google. And since its been there, my junk mail has gone up about 500%. Since then, the traffic is actually disapointing, but accurately displayed. :) But considering that Google hasnt found that part of my site yet, its not surprising. |
Re: IP Addresses in Users Online for all users
This is a great mod! Thanks all of you.
For 4.1.10 - I followed Post #1 with the following: auth.php - no changes to Post #1 modules>Users_online>stats.php Instead of this change Quote:
I did this Quote:
skin1>modules>Users_online>stats.tpl Instead of this change Quote:
I did this Quote:
Thank you Hamid very much! Paul |
Re: IP Addresses in Users Online for all users
Hi Paul
Glad you like it - I can't imagine living without it now :) Hamid |
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'])) { change to .. Code:
if (!empty($active_modules['Users_online'])) { in modules/Users_online/stats.php find ... Code:
$rec['session_create_date'] = $data['session_create_date']+$config["Appearance"]["timezone_offset"]; change to .. Code:
$rec['session_create_date'] = $data['session_create_date']+$config["Appearance"]["timezone_offset"]; 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> |
Re: IP Addresses in Users Online for all users
Works without modifications.
Thanks. |
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?
|
Re: IP Addresses in Users Online for all users
Quote:
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. |
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 |
Re: IP Addresses in Users Online for all users
Quote:
Stizerg, Thanks! I comment it out and users online is removed from store front. Is this what you did? Gary |
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... |
Re: IP Addresses in Users Online for all users
Quote:
Find this in your stats.tpl Code:
and change it to: Code:
It's working for me so far and it also gives you a google map with the location! |
Re: IP Addresses in Users Online for all users
as advertised. very nice.
where do I sent the check :-) Cheers Don... |
Re: IP Addresses in Users Online for all users
Quote:
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? |
Re: IP Addresses in Users Online for all users
Quote:
A little different change for this one... Find: Code:
http://www.dnsstuff.com/tools/whois.ch?ip={$v.session_ip}&cache=off" target="_blank">{$v.session_ip}</a> And change to: Code:
http://www.netip.de/search?query={$v.session_ip}" target=_blank">{$v.session_ip}</a> |
Re: IP Addresses in Users Online for all users
thanks, that link looks a much better proposition.
Cheers Don... |
Re: IP Addresses in Users Online for all users
I like that one better myself, but don't know how accurate it will be. I just checked one that should be from Florida (USA), but it shows it's location as in the water, on the equator, off the coast of Africa.
|
Re: IP Addresses in Users Online for all users
Quote:
http://phpweby.com/services/iplocation?ip={$v.session_ip}" target=_blank">{$v.session_ip}</a> This one is more accurate and free. |
Re: IP Addresses in Users Online for all users
I have run into that problem when I worked with the Google Maps API, that location is 0,0. Basically, it couldn't locate it.
|
Re: IP Addresses in Users Online for all users
Quote:
I haven't got the same problem yet after switch. And the new one works well for me. |
Re: IP Addresses in Users Online for all users
Neorag,
I followed your exact steps, all seems ok, but the IP address is not showing up. Im using 4.2.2 |
Re: IP Addresses in Users Online for all users
I see some are using this with 4.2, but when I look for auth.php I only see auth.tpl and I don't see the users online code.
This is what I have: Code:
{* |
Re: IP Addresses in Users Online for all users
I know this is an old thread but I have 4.2.2 and my postauth.php is different than the example given on any page. My postauth.php looks like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <?php
/************************************************** ***************************\ # # $Id: postauth.php,v 1.6.2.2 2009/06/18 07:34:23 aim Exp $ # if ( !defined('XCART_START') ) { header("Location: home.php"); die("Access denied"); } # Prevent double inclusion. if (defined('INCLUDED_POSTAUTH_PHP')) { return; } define('INCLUDED_POSTAUTH_PHP', 1); x_session_register("logout_user"); x_session_register("session_failed_transaction"); x_session_register("add_to_cart_time"); x_session_register("always_allow_shop"); x_session_register("search_data"); if (!empty($_GET["shopkey"])) $always_allow_shop = (!empty($config["General"]["shop_closed_key"]) && $_GET["shopkey"] == $config["General"]["shop_closed_key"]); if ($config["General"]["shop_closed"] == "Y" && !$always_allow_shop){ # # Close store front # Thanks to rubyaryat for the Shop Closed mod # if (!func_readfile($xcart_dir.DIRECTORY_SEPARATOR.$sh op_closed_file, true)) echo func_get_langvar_by_name("txt_shop_temporarily_una ccessible",false,false,true); exit(); } require $xcart_dir."/include/nocookie_warning.php"; if (!defined('HTTPS_CHECK_SKIP')) { @include $xcart_dir.DIR_CUSTOMER."/https.php"; } if (!empty($active_modules['Users_online']) || !empty($active_modules["Greet_Visitor"])) { x_session_register("session_create_date"); if (empty($session_create_date)) $session_create_date = time(); } if (!empty($active_modules['Users_online'])) { x_session_register("current_url_page"); x_session_register("current_date"); $current_url_page = $php_url['url'].($php_url['query_string']?"?".$php_url['query_string']:""); $current_date = time(); } # # Display # x_session_register("wlid"); if (isset($_GET["wlid"]) and $_GET["wlid"]) $wlid = $_GET["wlid"]; $smarty->assign("wlid", $wlid); # # Browser have disabled/enabled javasript switching # x_session_register("js_enabled", "Y"); if (!isset($js_enabled)) $js_enabled="Y"; if (isset($_GET["js"])) { if ($_GET["js"]=="y") { $js_enabled = "Y"; $config['Adaptives']['isJS'] = "Y"; $adaptives['isJS'] = "Y"; } elseif ($_GET["js"]=="n") { $js_enabled = ""; } } $qry_string = func_qs_remove($php_url['query_string'], 'js'); $js_update_link = $php_url['url'].'?'.(!empty($qry_string) ? $qry_string."&" : ""); if ($js_enabled == "Y") { $js_update_link .= "js=n"; } else { $js_update_link .= "js=y"; } unset($qry_string); $smarty->assign("js_update_link", $js_update_link); $smarty->assign("js_enabled", $js_enabled); x_session_register("top_message"); if (!empty($top_message)) { $top_message['type'] = !empty($top_message['type']) ? $top_message['type'] : "I"; switch ($top_message['type']) { case "E": $top_message['title'] = func_get_langvar_by_name("lbl_error", array(), false, true); break; case "W": $top_message['title'] = func_get_langvar_by_name("lbl_warning", array(), false, true); break; default: $top_message['title'] = func_get_langvar_by_name("lbl_information", array(), false, true); } $smarty->assign("top_message", $top_message); if ($config['Adaptives']['is_first_start'] != 'Y') $top_message = ""; x_session_save("top_message"); } $cat = intval(@$cat); $page = intval(@$page); if (!empty($active_modules['XAffiliate'])) { include $xcart_dir."/include/partner_info.php"; include $xcart_dir."/include/adv_info.php"; } include $xcart_dir.DIR_CUSTOMER."/referer.php"; include $xcart_dir."/include/check_useraccount.php"; include $xcart_dir."/include/get_language.php"; $lbl_site_name = strip_tags(func_get_langvar_by_name("lbl_site_titl e", "", false, true)); $location = array(); $location[] = array((!empty($lbl_site_name) ? $lbl_site_name : $config["Company"]["company_name"]), "home.php"); include $xcart_dir.DIR_CUSTOMER."/minicart.php"; if (!empty($active_modules["Interneka"])) { include $xcart_dir."/modules/Interneka/interneka.php"; } if (!empty($active_modules["Subscriptions"])) { if ($login) { include $xcart_dir."/modules/Subscriptions/get_subscription_info.php"; $smarty->assign("user_subscription", is_user_subscribed($login)); } } $pages_menu = func_query("SELECT * FROM $sql_tbl[pages] WHERE language='$store_language' AND active='Y' AND level='E' AND show_in_menu='Y' ORDER BY orderby, title"); $smarty->assign("pages_menu", $pages_menu); $speed_bar = unserialize($config["speed_bar"]); if (!empty($speed_bar)) { $tmp_labels = array(); foreach ($speed_bar as $k => $v) { if ($v["active"] != "Y") { unset($speed_bar[$k]); continue; } $speed_bar[$k] = func_array_map("stripslashes", $v); $tmp_labels[] = "speed_bar_".$v['id']; } if (!empty($speed_bar)) { $tmp = func_get_languages_alt($tmp_labels); foreach ($speed_bar as $k => $v) { if (isset($tmp['speed_bar_'.$v['id']])) $speed_bar[$k]['title'] = $tmp['speed_bar_'.$v['id']]; } $smarty->assign("speed_bar", array_reverse($speed_bar)); } } unset($speed_bar); $smarty->assign("redirect", "customer"); if (!empty($active_modules["News_Management"])) include $xcart_dir."/modules/News_Management/news_last.php"; if (!empty($active_modules["Feature_Comparison"])) { include $xcart_dir."/modules/Feature_Comparison/comparison_products.php"; if ($config['Feature_Comparison']['fcomparison_show_product_list'] == 'Y') { $comparison_list = func_get_comparison_list(); $smarty->assign("comparison_list",$comparison_list); } } if (!empty($active_modules["Survey"])) { include_once $xcart_dir."/modules/Survey/surveys_list.php"; } if (!empty($active_modules['Special_Offers'])) { include_once $xcart_dir."/modules/Special_Offers/check_new_offers.php"; } if (isset($printable)) $smarty->assign("printable", $printable); $smarty->assign("logout_user", $logout_user); ?> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ I hate to just assume I can change anything even if it doesn't like the examples given. Anyone able to help?? Thank you! A1Gifts www.A1DiscountGifts.com |
Re: IP Addresses in Users Online for all users
Works perfect for me in 4.1! I just added a <br/> before the "IP:" as I prefer the IP to display underneath customer in admin. Thanks for sharing!
Not sure if this already shows up in your admin area but it does not in mine and it was a bit frustrating for me as I also wanted to be able to see from my admin "users online" the actual amount of users on my site as well as the amount of adminastrators that is logged into admin so this is what I did In xcart>skin1>modules>Users_online>stats.tpl at the top line 2 right underneath {* $Id: stats.tpl............ I placed the following code {if $users_online} <div class="BottomDialogBox"> {$lng.lbl_users_online}: {foreach from=$users_online item=v name="_users"} <font class="VertMenuItems" style="WHITE-SPACE: nowrap;">{$v.count} {strip} {if $v.usertype eq 'A' || ($v.usertype eq 'P' && $active_modules.Simple_Mode)} {$lng.lbl_admin_s} {elseif $v.usertype eq 'P'} {$lng.lbl_provider_s} {elseif $v.usertype eq 'B'} {$lng.lbl_partner_s} {elseif $v.usertype eq 'C' && $v.is_registered eq 'Y'} {$lng.lbl_registered_customer_s} {elseif $v.usertype eq 'C' && $v.is_registered eq 'A'} {$lng.lbl_anonymous_customer_s} {elseif $v.usertype eq 'C' && $v.is_registered eq ''} {$lng.lbl_unregistered_customer_s} {/if} {if not $smarty.foreach._users.last} {/if} {/strip} </font> {/foreach} </div> {/if} I also placed the same code right at the bottom of stats.tpl underneath all code as it makes that bit of a difference to me Quote:
|
All times are GMT -8. The time now is 12:42 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.