Guest Posted January 3, 2004 Share Posted January 3, 2004 Hmmm, seems it doesn't like the new year... Looking at the chart for "by days this month" and the chart is giving me numbers for all days this month, and the numbers are outlandish (over 8,000 in some cases). it looks like it's for "by days last year". Is anyone else seeing this? If so, have you figured a workaround (kluge)? Quote Link to comment Share on other sites More sharing options...
Guest Posted January 3, 2004 Share Posted January 3, 2004 Hate to follow up my own post, but the problem looks like: $visitor_stats_query = tep_db_query("select DAYOFMONTH(date) as name, count(counter) as value from visitors where MONTH(now()) - MONTH(date) < 1 group by DAYOFMONTH(date)"); It also looks like some of the other reports have gone to pot... (search engine keywords is now non-functional as well) :( Quote Link to comment Share on other sites More sharing options...
azer Posted January 3, 2004 Share Posted January 3, 2004 i noticed the same here .. wich version do u use! Quote MS2 Link to comment Share on other sites More sharing options...
Guest Posted January 3, 2004 Share Posted January 3, 2004 i noticed the same here .. wich version do u use! 1.6c Quote Link to comment Share on other sites More sharing options...
Sammy1001 Posted January 5, 2004 Share Posted January 5, 2004 Same problem here, version is 1.6 c... Quote Sammy 1001 Link to comment Share on other sites More sharing options...
Salvo Posted January 5, 2004 Share Posted January 5, 2004 Strange but true. I have the same problem. Now how do we solve it? Quote Link to comment Share on other sites More sharing options...
Guest Posted January 6, 2004 Share Posted January 6, 2004 Strange but true. I have the same problem. Now how do we solve it? normally the person who wrote the tool is using the tool, notices the problem and then fixes it with a release or update. that appears to not be the case here. So, I have been dinking around with it, but I'm not quite sure what the fix is at this time (it's dates and SQL, not a personal strong point of mine) My hope is that the original author will get a fix posted before I have a chance to hack at it. If not, then after I move my store to a new host, I'll take a look at it. :( Quote Link to comment Share on other sites More sharing options...
Ian-San Posted January 6, 2004 Share Posted January 6, 2004 normally the person who wrote the tool is using the tool, notices the problem and then fixes it with a release or update. He did! But I don't use this contribution anymore ... :( The problem is an easy fix and I will try to make a new contribution later this week. In the meantime, you may just try to paste in these changes: switch ($report) { case "1": // By Hours Today $visitor_stats_query = tep_db_query("select HOUR(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " where to_days(now()) - to_days(date) < 1 group by HOUR(date)"); break; case "3": // By Months this Year $visitor_stats_query = tep_db_query("select MONTHNAME(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " where YEAR(now()) - YEAR(date) < 1 group by MONTH(date)"); break; case "4": // All by Year $visitor_stats_query = tep_db_query("select YEAR(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " group by YEAR(date)"); break; case "5": // All by Hours $visitor_stats_query = tep_db_query("select HOUR(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " group by HOUR(date)"); break; case "6": // All by Day of Month $visitor_stats_query = tep_db_query("select DAYOFMONTH(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " group by DAYOFMONTH(date)"); break; case "7": // Average Clicks per IP by Days $visitor_stats_query = tep_db_query("select DAYOFMONTH(date) as name, avg(counter) as value FROM " . TABLE_VISITORS . " group by DAYOFMONTH(date)"); break; case "8": // Total Clicks by Top Countries $visitor_stats_query = tep_db_query("select browser_language as name, sum(counter) as value FROM " . TABLE_VISITORS . " group by browser_language"); break; case "9": // Total Clicks by Site Language $visitor_stats_query = tep_db_query("select language as name, sum(counter) as value FROM " . TABLE_VISITORS . " group by language"); break; case "10": // Search Engine Keywords $visitor_stats_query = tep_db_query("select referer as name, count(counter) as value FROM " . TABLE_VISITORS . " group by referer"); break; case "11": // NYA $visitor_stats_query = tep_db_query("select DAYOFMONTH(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " where MONTH(now()) - MONTH(date) < 1 and YEAR(now()) - YEAR(date) < 1 group by DAYOFMONTH(date)"); break; case "12": // NYA $visitor_stats_query = tep_db_query("select DAYOFMONTH(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " where MONTH(now()) - MONTH(date) < 1 and YEAR(now()) - YEAR(date) < 1 group by DAYOFMONTH(date)"); break; default: // By Days this Month $visitor_stats_query = tep_db_query("select DAYOFMONTH(date) as name, count(counter) as value FROM " . TABLE_VISITORS . " where MONTH(now()) - MONTH(date) < 1 and YEAR(now()) - YEAR(date) < 1 group by DAYOFMONTH(date)"); } and in application_top: // 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'; } $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,counter,browser_ip,browser_language,language,referer,uri) values (now(),'".$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 Plus you will need to define TABLE_VISITORS in database tables: define('TABLE_VISITORS', 'visitors'); I will do a diff on my version and the one contributed and see what changes are required. Quote Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Ian-San Posted January 6, 2004 Share Posted January 6, 2004 I started a new post here: http://www.oscommerce.com/forums/index.php?act=ST&f=7&t=72775 Quote Ian-san Flawlessnet Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.