get_country_codes(); $rangestartdate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangestart_utime ); $rangeenddate = $WP_Statistics->real_current_date( 'Y-m-d', '-0', $rangeend_utime ); $result = $wpdb->get_results( sprintf( "SELECT `location`, COUNT(`location`) AS `count` FROM `{$wpdb->prefix}statistics_visitor` WHERE `last_counter` BETWEEN '%s' AND '%s' GROUP BY `location` ORDER BY `count` DESC", $rangestartdate, $rangeenddate ) ); $i = 0; foreach ( $result as $item ) { $i ++; $item->location = strtoupper( $item->location ); echo "
"; echo "
$i
"; echo "
location . '.png' ) . "' title='{$ISOCountryCode[$item->location]}'/>
"; echo "
{$ISOCountryCode[$item->location]}
"; echo "
" . number_format_i18n( $item->count ) . "
"; echo "
"; } ?>