|
@@ 1454-1457 (lines=4) @@
|
| 1451 |
|
// Get latitude and longitude |
| 1452 |
|
$latitude = 0; |
| 1453 |
|
$longitude = 0; |
| 1454 |
|
for ( $j = 0; $j < 3; ++$j ) { |
| 1455 |
|
$char = ord( substr( $record_buf, $record_buf_pos++, 1 ) ); |
| 1456 |
|
$latitude += ( $char << ( $j * 8 ) ); |
| 1457 |
|
} |
| 1458 |
|
|
| 1459 |
|
$record->latitude = ( $latitude / 10000 ) - 180; |
| 1460 |
|
|
|
@@ 1461-1464 (lines=4) @@
|
| 1458 |
|
|
| 1459 |
|
$record->latitude = ( $latitude / 10000 ) - 180; |
| 1460 |
|
|
| 1461 |
|
for ( $j = 0; $j < 3; ++$j ) { |
| 1462 |
|
$char = ord( substr( $record_buf, $record_buf_pos++, 1 ) ); |
| 1463 |
|
$longitude += ( $char << ( $j * 8 ) ); |
| 1464 |
|
} |
| 1465 |
|
|
| 1466 |
|
$record->longitude = ( $longitude / 10000 ) - 180; |
| 1467 |
|
|
|
@@ 1471-1474 (lines=4) @@
|
| 1468 |
|
if ( self::GEOIP_CITY_EDITION_REV1 == $this->databaseType ) { |
| 1469 |
|
$metroarea_combo = 0; |
| 1470 |
|
if ( $record->country_code == "US" ) { |
| 1471 |
|
for ( $j = 0; $j < 3; ++$j ) { |
| 1472 |
|
$char = ord( substr( $record_buf, $record_buf_pos++, 1 ) ); |
| 1473 |
|
$metroarea_combo += ( $char << ( $j * 8 ) ); |
| 1474 |
|
} |
| 1475 |
|
|
| 1476 |
|
$record->metro_code = $record->dma_code = floor( $metroarea_combo / 1000 ); |
| 1477 |
|
$record->area_code = $metroarea_combo % 1000; |