noob Posted July 25, 2004 Posted July 25, 2004 hi i was wonderin if any of u guys would tell me how to exclude my ip out of the reports since im stil working on my site i visit it very often and it messes with the stats thanks Checkout my osc contrib here! You can also checkout the site im working on by clicking the card button!
noob Posted July 25, 2004 Author Posted July 25, 2004 anyone? :( Checkout my osc contrib here! You can also checkout the site im working on by clicking the card button!
noob Posted July 25, 2004 Author Posted July 25, 2004 bump :unsure: Checkout my osc contrib here! You can also checkout the site im working on by clicking the card button!
♥yesudo Posted July 26, 2004 Posted July 26, 2004 don't bump. Anyway try this - put this around any inserts or updates to the visitor table in the contrib: if($b_ip != (your ip addy) { db query; } Your online success is Paramount.
noob Posted July 26, 2004 Author Posted July 26, 2004 thx for replying is "your ip addy" the only thing i have to change where exactly should i put that these are the script changes: 2) Add the data capture lines to catalog/includes/application_top.php: Find: // language if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) { if (!tep_session_is_registered('language')) { tep_session_register('language'); tep_session_register('languages_id'); } include(DIR_WS_CLASSES . 'language.php'); $lng = new language($HTTP_GET_VARS['language']); if (!$HTTP_GET_VARS['language']) $lng->get_browser_language(); $language = $lng->language['directory']; $languages_id = $lng->language['id']; } Change to: // language if (!tep_session_is_registered('language') || isset($HTTP_GET_VARS['language'])) { if (!tep_session_is_registered('language')) { tep_session_register('language'); tep_session_register('languages_id'); } include(DIR_WS_CLASSES . 'language.php'); $lng = new language($HTTP_GET_VARS['language']); if (!isset($HTTP_GET_VARS['language'])) $lng->get_browser_language(); $language = $lng->language['directory']; $languages_id = $lng->language['id']; // Visitors Start $b_lang = getenv('HTTP_ACCEPT_LANGUAGE'); $referer = getenv('HTTP_REFERER'); if ($referer == '') { $referer = 'direct'; } $uri = getenv('REQUEST_URI'); if ( function_exists('tep_get_ip_address') ) { $b_ip = tep_get_ip_address(); } else { $b_ip = getenv('REMOTE_ADDR'); } if ($b_lang == '') { $b_lang = 'robot'; } if ($customer_id) { $log_id = $customer_id; }else{ $log_id = 0; } $b_count = '1'; $ip_count = tep_db_query("select counter FROM " . TABLE_VISITORS . " where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"); if (!tep_db_num_rows($ip_count)) { tep_db_query("insert into " . TABLE_VISITORS . " (date,customers_id,counter,browser_ip,browser_language,language,referer,uri) values (now(),'".$log_id."','".$b_count."','".$b_ip."','".$b_lang."','".$language."','".$referer."','".$uri."')"); } else { $ip_values = tep_db_fetch_array($ip_count); $b_count = ($ip_values['counter'] + 1); tep_db_query("update " . TABLE_VISITORS . " set counter = '" . $b_count . "', date = now() where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"); } // Visitors End } 2b) Add the following to catalog/login.php just before "// restore cart contents" //Changes for visitor stats. Add the customer id if known $b_lang = getenv('HTTP_ACCEPT_LANGUAGE'); $b_ip = getenv('REMOTE_ADDR'); $visitor_query_string = "update visitors set customers_id = '" . $customer_id . "' where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"; //print('<br>' . $visitor_query_string . '<br>'); tep_db_query($visitor_query_string); //end changes for visitor stats 2c) Add the following to catalog/create_account.php just before "if (SESSION_RECREATE == 'True') {" //Changes for visitor stats. Add the customer id if known $b_lang = getenv('HTTP_ACCEPT_LANGUAGE'); $b_ip = getenv('REMOTE_ADDR'); $visitor_query_string = "update visitors set customers_id = '" . (int)$customer_id . "' where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"; //print('<br>' . $visitor_query_string . '<br>'); tep_db_query($visitor_query_string); //end changes for visitor stats i really apreciate your help :) Checkout my osc contrib here! You can also checkout the site im working on by clicking the card button!
♥yesudo Posted July 26, 2004 Posted July 26, 2004 I haven't got this contrib installed so have not had a chance to test:- http://www.hostingoscommerce.com/example.txt Let me know how it goes. Your online success is Paramount.
noob Posted July 26, 2004 Author Posted July 26, 2004 this is what it says when i visit it: Parse error: parse error in /home/dollward/public_html/catalog/includes/application_top.php on line 301 Warning: main(DIR_WS_LANGUAGES/FILENAME_DEFAULT): failed to open stream: No such file or directory in /home/dollward/public_html/catalog/index.php on line 33 Fatal error: main(): Failed opening required 'DIR_WS_LANGUAGES/FILENAME_DEFAULT' (include_path='.:/usr/local/lib/php') in /home/dollward/public_html/catalog/index.php on line 33 this is what the files look lie as of now: the application_top.php: // Visitors Start $b_lang = getenv('HTTP_ACCEPT_LANGUAGE'); $referer = getenv('HTTP_REFERER'); if ($referer == '') { $referer = 'direct'; } $uri = getenv('REQUEST_URI'); if ( function_exists('tep_get_ip_address') ) { $b_ip = tep_get_ip_address(); } else { $b_ip = getenv('REMOTE_ADDR'); } if ($b_lang == '') { $b_lang = 'robot'; } if ($customer_id) { $log_id = $customer_id; }else{ $log_id = 0; } $b_count = '1'; //addition!!!!!!!!exclude my ip addy if($b_ip != (144.90.8.2) { db query; } $ip_count = tep_db_query("select counter FROM " . TABLE_VISITORS . " where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"); if (!tep_db_num_rows($ip_count)) { tep_db_query("insert into " . TABLE_VISITORS . " (date,customers_id,counter,browser_ip,browser_language,language,referer,uri) values (now(),'".$log_id."','".$b_count."','".$b_ip."','".$b_lang."','".$language."','".$referer."','".$uri."')"); } else { $ip_values = tep_db_fetch_array($ip_count); $b_count = ($ip_values['counter'] + 1); tep_db_query("update " . TABLE_VISITORS . " set counter = '" . $b_count . "', date = now() where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"); } // Visitors End } // visitor traking addition the login.php: //Changes for visitor stats. Add the customer id if known $b_lang = getenv('HTTP_ACCEPT_LANGUAGE'); $b_ip = getenv('REMOTE_ADDR'); $visitor_query_string = "update visitors set customers_id = '" . $customer_id . "' where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"; //addition!!!!!!!!exclude my ip addy if($b_ip != (144.90.8.2) { db query; } //print('<br>' . $visitor_query_string . '<br>'); tep_db_query($visitor_query_string); //end changes for visitor stats and the create_account.php: //Changes for visitor stats. Add the customer id if known $b_lang = getenv('HTTP_ACCEPT_LANGUAGE'); $b_ip = getenv('REMOTE_ADDR'); $visitor_query_string = "update visitors set customers_id = '" . (int)$customer_id . "' where browser_ip = '" . $b_ip . "' AND browser_language = '" . $b_lang . "' AND to_days(now()) - to_days(date) < 1"; //addition!!!!!!!!exclude my ip addy if($b_ip != (144.90.8.2) { db query; } //print('<br>' . $visitor_query_string . '<br>'); tep_db_query($visitor_query_string); //end changes for visitor stats thx for tryin to help Checkout my osc contrib here! You can also checkout the site im working on by clicking the card button!
♥yesudo Posted July 26, 2004 Posted July 26, 2004 send me those files - [email protected]. Your online success is Paramount.
♥yesudo Posted July 27, 2004 Posted July 27, 2004 I have now added the solution to the contrib. http://www.oscommerce.com/forums/index.php?sho...00entry414731 Your online success is Paramount.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.