'" . $trace_days . "')"); // set the top level domain function visitor_get_top_level_domain($url) { if (strpos($url, '://')) { $url = parse_url($url); $url = $url['host']; } $domain_array = explode('.', $url); $domain_size = sizeof($domain_array); if ($domain_size > 1) { if (is_numeric($domain_array[$domain_size-2]) && is_numeric($domain_array[$domain_size-1])) { return false; } else { return $domain_array[$domain_size-2] . '.' . $domain_array[$domain_size-1]; } } else { return false; } } $current_domain = visitor_get_top_level_domain(HTTP_SERVER); $cookie_path = '/'; // Could change if not using a top level path if ( ($HTTP_GET_VARS['display_robot'] && $HTTP_GET_VARS['display_robot'] == 'yes' ) || (!$HTTP_GET_VARS['display_robot'] && isset($HTTP_COOKIE_VARS["display_robot"]) && $HTTP_COOKIE_VARS["display_robot"] == 'yes') ) { $robot = ""; $display_robot = 'yes'; if ($use_cookie == '1') { setcookie('display_robot', 'yes', time()+ (365 * 5 * 24 * 3600), $cookie_path, $current_domain, ((getenv('HTTPS') == 'on') ? 1 : 0)); // set robot cookie } } else { $robot = "AND SUBSTRING(browser_language,1,1) != '['"; $display_robot = 'no'; if ($use_cookie == '1') { setcookie('display_robot', 'no', time()+ (365 * 5 * 24 * 3600), $cookie_path, $current_domain, ((getenv('HTTPS') == 'on') ? 1 : 0)); // set robot cookie } } function visitor_get_country_language($country_code) { if (substr($country_code, 0, 1) == '[') { $country_name = 'Network'; } else { $code1 = substr($country_code,0,2); $code2 = substr($country_code,3,2); $country_name = 'Unknown/LAN'; if ($code1 == "af") {$country_name = 'Afrikaans';} if ($code1 == "ar") { $country_name = 'Arabic'; if ($code2 == "ae") {$country_name = 'UAE';} if ($code2 == "bh") {$country_name = 'Bahrain';} if ($code2 == "eg") {$country_name = 'Egypt';} if ($code2 == "dz") {$country_name = 'Algeria';} if ($code2 == "iq") {$country_name = 'Iraq';} if ($code2 == "jo") {$country_name = 'Jordan';} if ($code2 == "kw") {$country_name = 'Kuwait';} if ($code2 == "lb") {$country_name = 'Lebanon';} if ($code2 == "ly") {$country_name = 'Libya';} if ($code2 == "ma") {$country_name = 'Morocco';} if ($code2 == "om") {$country_name = 'Oman';} if ($code2 == "qa") {$country_name = 'Qatar';} if ($code2 == "sa") {$country_name = 'Saudi';} if ($code2 == "sy") {$country_name = 'Syria';} if ($code2 == "tn") {$country_name = 'Tunisia';} if ($code2 == "ye") {$country_name = 'Yemen';}} if ($code1 == "be") {$country_name = 'Belarusian';} if ($code1 == "bg") {$country_name = 'Bulgarian';} if ($code1 == "ca") {$country_name = 'Catalan';} if ($code1 == "cs") {$country_name = 'Czech';} if ($code1 == "da") {$country_name = 'Danish';} if ($code1 == "de") { $country_name = 'Germany'; if ($code2 == "at") {$country_name = 'Austria';} if ($code2 == "ch") {$country_name = 'Switzerland';} if ($code2 == "li") {$country_name = 'Liechtenstein';} if ($code2 == "lu") {$country_name = 'Luxembourg';}} if ($code1 == "el") {$country_name = 'Greece';} if ($code1 == "en") { $country_name = 'Other English'; if ($code2 == "us") {$country_name = 'USA';} if ($code2 == "au") {$country_name = 'Australia';} if ($code2 == "bz") {$country_name = 'Belize';} if ($code2 == "ca") {$country_name = 'Canada';} if ($code2 == "gb") {$country_name = 'UK';} if ($code2 == "ie") {$country_name = 'Ireland';} if ($code2 == "jm") {$country_name = 'Jamaica';} if ($code2 == "nz") {$country_name = 'New Zealand';} if ($code2 == "tt") {$country_name = 'Trinidad';} if ($code2 == "za") {$country_name = 'South Africa';}} if ($code1 == "es") { $country_name = 'Spain'; if ($code2 == "ar") {$country_name = 'Argentina';} if ($code2 == "bo") {$country_name = 'Bolivia';} if ($code2 == "cl") {$country_name = 'Chile';} if ($code2 == "co") {$country_name = 'Colombia';} if ($code2 == "cr") {$country_name = 'Costa Rica';} if ($code2 == "do") {$country_name = 'Dominican';} if ($code2 == "ec") {$country_name = 'Ecuador';} if ($code2 == "gt") {$country_name = 'Guatemala';} if ($code2 == "hn") {$country_name = 'Honduras';} if ($code2 == "mx") {$country_name = 'Mexico';} if ($code2 == "ni") {$country_name = 'Nicaragua';} if ($code2 == "pa") {$country_name = 'Panama';} if ($code2 == "pe") {$country_name = 'Peru';} if ($code2 == "pr") {$country_name = 'Puerto Rico';} if ($code2 == "py") {$country_name = 'Paraguay';} if ($code2 == "sv") {$country_name = 'El Salvador';} if ($code2 == "uy") {$country_name = 'Uruguay';} if ($code2 == "ve") {$country_name = 'Venezuela';}} if ($code1 == "et") {$country_name = 'Estonian';} if ($code1 == "eu") {$country_name = 'Basque';} if ($code1 == "fa") {$country_name = 'Farsi';} if ($code1 == "fi") {$country_name = 'Finland';} if ($code1 == "fo") {$country_name = 'Faeroes';} if ($code1 == "fr") { $country_name = 'France'; if ($code2 == "be") {$country_name = 'Belgium';} if ($code2 == "ca") {$country_name = 'Canada';} if ($code2 == "ch") {$country_name = 'Switzerland';} if ($code2 == "ca") {$country_name = 'Luxembourg';}} if ($code1 == "gd") { $country_name = 'Scotland'; if ($code2 == "ie") {$country_name = 'Ireland';}} if ($code1 == "he") {$country_name = 'Hebrew';} if ($code1 == "hi") {$country_name = 'Hindi';} if ($code1 == "hr") {$country_name = 'Croatian';} if ($code1 == "hu") {$country_name = 'Hungarian';} if ($code1 == "in") {$country_name = 'Indonesian';} if ($code1 == "is") {$country_name = 'Icelandic';} if ($code1 == "he") {$country_name = 'Hebrew';} if ($code1 == "it") { $country_name = 'Italy'; if ($code2 == "ch") {$country_name = 'Switzerland';}} if ($code1 == "ja") {$country_name = 'Japan';} if ($code1 == "ji") {$country_name = 'Yiddish';} if ($code1 == "ko") {$country_name = 'Korea';} if ($code1 == "lt") {$country_name = 'Lithuania';} if ($code1 == "lv") {$country_name = 'Latvian';} if ($code1 == "mk") {$country_name = 'Macedonia';} if ($code1 == "ms") {$country_name = 'Malaysia';} if ($code1 == "mt") {$country_name = 'Malta';} if ($code1 == "nl") { $country_name = 'Netherlands'; if ($code2 == "be") {$country_name = 'Belgium';}} if ($code1 == "no") {$country_name = 'Norway';} if ($code1 == "pl") {$country_name = 'Poland';} if ($code1 == "pt") { $country_name = 'Portugual'; if ($code2 == "br") {$country_name = 'Brazil';}} if ($code1 == "rm") {$country_name = 'Romania';} if ($code1 == "ro") {$country_name = 'Romania';} if ($code1 == "ru") {$country_name = 'Russia';} if ($code1 == "sb") {$country_name = 'Sorbian';} if ($code1 == "sk") {$country_name = 'Slovak';} if ($code1 == "sl") {$country_name = 'Slovenian';} if ($code1 == "sq") {$country_name = 'Albania';} if ($code1 == "sr") {$country_name = 'Serbia';} if ($code1 == "sv") { $country_name = 'Sweden'; if ($code2 == "fi") {$country_name = 'Finland';}} if ($code1 == "sx") {$country_name = 'Sutu';} if ($code1 == "sz") {$country_name = 'Sami';} if ($code1 == "tn") {$country_name = 'Tswana';} if ($code1 == "tr") {$country_name = 'Turkey';} if ($code1 == "ts") {$country_name = 'Tsonga';} if ($code1 == "uk") {$country_name = 'Ukrainian';} if ($code1 == "th") {$country_name = 'Thailand';} if ($code1 == "ur") {$country_name = 'Urdu';} if ($code1 == "ve") {$country_name = 'Venda';} if ($code1 == "vi") {$country_name = 'Vietnam';} if ($code1 == "xh") {$country_name = 'Xhosa';} if ($code1 == "zh") { $country_name = 'China'; if ($code2 == "cn") {$country_name = 'China';} if ($code2 == "hk") {$country_name = 'Hong Kong';} if ($code2 == "sg") {$country_name = 'Singapore';} if ($code2 == "tw") {$country_name = 'Taiwan';}} if ($code1 == "zu") {$country_name = 'Zulu';} } return $country_name; } // check if the graphs directory exists $show_charts = false; if ( function_exists('imagecreate') ) { if (is_dir(DIR_WS_IMAGES . 'graphs')) { if (is_writeable(DIR_WS_IMAGES . 'graphs')) { $show_charts = true; } else { $messageStack->add(ERROR_GRAPHS_DIRECTORY_NOT_WRITEABLE, 'error'); } } else { $messageStack->add(ERROR_GRAPHS_DIRECTORY_DOES_NOT_EXIST, 'error'); $show_charts = false; } } if ( ($gd_support != '1') || (!function_exists('imagecreate')) ) { $show_charts = false; } if ($show_charts == false) { $report = '10'; } else { $report = $default_report; } if ( ($HTTP_GET_VARS['report']) && (tep_not_null($HTTP_GET_VARS['report'])) ) { $report = $HTTP_GET_VARS['report']; } $chart1 = 'menuBoxContentLink'; $chart2 = 'menuBoxContentLink'; $chart3 = 'menuBoxContentLink'; $chart4 = 'menuBoxContentLink'; $chart5 = 'menuBoxContentLink'; $chart6 = 'menuBoxContentLink'; $chart7 = 'menuBoxContentLink'; $chart8 = 'menuBoxContentLink'; $chart9 = 'menuBoxContentLink'; $chart10 = 'menuBoxContentLink'; $chart11 = 'menuBoxContentLink'; $chart12 = 'menuBoxContentLink'; $chart13 = 'menuBoxContentLink'; $chart20 = 'menuBoxContentLink'; $chart21 = 'menuBoxContentLink'; $chart22 = 'menuBoxContentLink'; $chart23 = 'menuBoxContentLink'; $chart24 = 'menuBoxContentLink'; $chart25 = 'menuBoxContentLink'; $chart26 = 'menuBoxContentLink'; $chart27 = 'menuBoxContentLink'; $chart28 = 'menuBoxContentLink'; $chart29 = 'menuBoxContentLink'; $chart30 = 'menuBoxContentLink'; $chart31 = 'menuBoxContentLink'; $chart32 = 'menuBoxContentLink'; $chart33 = 'menuBoxContentLink'; $chart34 = 'menuBoxContentLink'; $chart35 = 'menuBoxContentLink'; $chart36 = 'menuBoxContentLink'; $chart37 = 'menuBoxContentLink'; $chart38 = 'menuBoxContentLink'; $chart39 = 'menuBoxContentLink'; $chart40 = 'menuBoxContentLink'; $chart41 = 'menuBoxContentLink'; $chart42 = 'menuBoxContentLink'; $chart43 = 'menuBoxContentLink'; $chart44 = 'menuBoxContentLink'; $chart45 = 'menuBoxContentLink'; switch ($report) { case '1': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_1; $chart1 = 'messageStackSuccess'; break; case '3': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_3; $chart3 = 'messageStackSuccess'; break; case '4': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_4; $chart4 = 'messageStackSuccess'; break; case '5': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_5; $chart5 = 'messageStackSuccess'; break; case '6': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_6; $chart6 = 'messageStackSuccess'; break; case '7': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_7; $chart7 = 'messageStackSuccess'; break; case '8': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_8; $chart8 = 'messageStackSuccess'; break; case '9': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_9; $chart9 = 'messageStackSuccess'; break; case '10': $title = STATISTICS_TYPE_REPORT_10; $chart10 = 'messageStackSuccess'; break; case '11': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_11; $chart11 = 'messageStackSuccess'; break; case '12': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_12; $chart12 = 'messageStackSuccess'; break; case '13': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_13; $chart13 = 'messageStackSuccess'; break; case '20': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_20; $chart20 = 'messageStackSuccess'; break; case '21': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_21; $chart21 = 'messageStackSuccess'; break; case '22': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_22; $chart22 = 'messageStackSuccess'; break; case '23': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_23; $chart23 = 'messageStackSuccess'; break; case '24': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_24; $chart24 = 'messageStackSuccess'; break; case '25': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_25; $chart25 = 'messageStackSuccess'; break; case '26': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_26; $chart26 = 'messageStackSuccess'; break; case '27': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_27; $chart27 = 'messageStackSuccess'; break; case '28': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_28; $chart28 = 'messageStackSuccess'; break; case '29': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_29; $chart29 = 'messageStackSuccess'; break; case '30': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_30; $chart30 = 'messageStackSuccess'; break; case '31': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_31; $chart31 = 'messageStackSuccess'; break; case '32': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_32; $chart32 = 'messageStackSuccess'; break; case '33': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_33; $chart33 = 'messageStackSuccess'; break; case '34': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_34; $chart34 = 'messageStackSuccess'; break; case '35': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_35; $chart35 = 'messageStackSuccess'; break; case '36': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_36; $chart36 = 'messageStackSuccess'; break; case '37': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_37; $chart37 = 'messageStackSuccess'; break; case '38': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_38; $chart38 = 'messageStackSuccess'; break; case '39': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_39; $chart39 = 'messageStackSuccess'; break; case '40': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_40; $chart40 = 'messageStackSuccess'; break; case '41': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_41; $chart41 = 'messageStackSuccess'; break; case '42': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_42; $chart42 = 'messageStackSuccess'; break; case '43': $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_43; $chart43 = 'messageStackSuccess'; break; case '44': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_44; $chart44 = 'messageStackSuccess'; break; case '45': $title = STATISTICS_TYPE_REPORT_B . ': ' . STATISTICS_TYPE_REPORT_45; $chart45 = 'messageStackSuccess'; break; case '50': $title = STATISTICS_TYPE_REPORT_50; $chart50 = 'messageStackSuccess'; break; default: $title = STATISTICS_TYPE_REPORT_A . ': ' . STATISTICS_TYPE_REPORT_2; $chart2 = 'messageStackSuccess'; } $years_array = array(); $years_query = tep_db_query("select distinct year(date) as visitor_year from " . TABLE_VISITORS . ""); while ($years = tep_db_fetch_array($years_query)) { $years_array[] = array('id' => $years['visitor_year'], 'text' => $years['visitor_year']); } // Something for an empty array if (sizeof($years_array) < 1) { $years_array = array(array('id' => date('Y'), 'text' => date('Y'))); } $months_array = array(); for ($i=1; $i<13; $i++) { $months_array[] = array('id' => $i, 'text' => strftime('%B', mktime(0,0,0,$i,15))); } $type_array = array(array('id' => 'daily', 'text' => HEADING_TYPE_DAILY), array('id' => 'monthly', 'text' => HEADING_TYPE_MONTHLY), array('id' => 'yearly', 'text' => HEADING_TYPE_YEARLY)); if ($HTTP_GET_VARS['action']) { switch ($HTTP_GET_VARS['action']) { case 'emptyconfirm': tep_db_query("TRUNCATE " . TABLE_VISITORS); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; case 'robotsconfirm': tep_db_query("DELETE FROM " . TABLE_VISITORS . " where SUBSTRING(browser_language,1,1) = '['"); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; case 'guestsconfirm': tep_db_query("DELETE FROM " . TABLE_VISITORS . " where customers_id='0'"); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; case 'datesconfirm': $delete_year = tep_db_prepare_input($HTTP_POST_VARS['delete_year']); $delete_month = tep_db_prepare_input($HTTP_POST_VARS['delete_month']); $delete_day = tep_db_prepare_input($HTTP_POST_VARS['delete_day']); tep_db_query("DELETE FROM " . TABLE_VISITORS . " where TO_DAYS(date) <= TO_DAYS('" . tep_db_input($delete_year) . "-" . tep_db_input($delete_month) . "-" . tep_db_input($delete_day) . "') - 1"); tep_redirect(tep_href_link(FILENAME_VISITORS)); break; case 'idconfirm': $delete_id = (int) tep_db_prepare_input($HTTP_POST_VARS['delete_id']); tep_db_query("delete from " . TABLE_VISITORS . " where browser_id = '$delete_id'"); tep_redirect(tep_href_link(FILENAME_VISITORS, tep_get_all_get_params(array('trace_pop_up', 'trace_date', 'trace_ip', 'page', 'action')).'page=' . $HTTP_GET_VARS['page'])); break; } } ?> >
|
|
' . HEADING_TITLE . ''; } else { echo HEADING_TITLE; } ?> | |||||||||||||||||||||||||||||||||||||
| ' . TABLE_HEADING_TRACE_TIME . ' | '; $trace_string .= '' . TABLE_HEADING_URI . ' | '; $trace_query = tep_db_query("select date, uri from " . TABLE_VISITORS_TRACE . " where browser_ip = '" . $trace_ip . "' AND (TO_DAYS(date) = TO_DAYS('" . $trace_date . "')) order by date DESC"); while ($trace = tep_db_fetch_array($trace_query)) { $trace_string .= '|||||||||||||||||||||||||||||||||||||
| ' . strrchr(tep_datetime_short($trace['date']), " ") . ' | '; if($trace["uri"] == '/') { $trace_string .= '' . TABLE_ROOT . ' | ' . chunk_split($trace["uri"],80," ") . ' | ';
}
}
echo '';
tep_session_register( 'bFlag' );
tep_session_register( 'tFlag' );
$bFlag = $trace_ip;
$tFlag = $HTTP_GET_VARS['trace_date'];
} else {
tep_session_unregister( 'bFlag' );
tep_session_unregister( 'tFlag' );
$bFlag = '';
$tFlag = '';
}
?>
||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||
';
if ($show_charts == true) {
echo '
|
||||||||||||||||||||||||||||||||||||||
' . "\n";
$box = new box;
$heading[] = array('align' => 'left', 'text' => CHART_BOX_TITLE);
echo $box->infoBox($heading, $contents);
if ($report == '10') {
$bgcolor = '99CCFF';
?>
| ' . "\n";
}
if ($show_charts == false){
echo ' ||||||||||||||||||||||||||||||||||||||
Sorry, I am unable to draw the other Charts as imagecreate() is not available in your version of php (check to see if you have gd support) or you switched off chart display | ' . "\n";
}
?>||||||||||||||||||||||||||||||||||||||