Pārlūkot izejas kodu

fixes

import/raw
memespring pirms 15 gadiem
vecāks
revīzija
6dffd16182
4 mainītis faili ar 29 papildinājumiem un 15 dzēšanām
  1. +1
    -1
      trunk/data/%%45^45E^45E480CD%%index.tpl.php
  2. +1
    -1
      trunk/data/%%F7^F7F^F7F34188%%header.tpl.php
  3. +11
    -6
      trunk/docs/include/scraper_support.php
  4. +16
    -7
      trunk/docs/preview.php

+ 1
- 1
trunk/data/%%45^45E^45E480CD%%index.tpl.php Parādīt failu

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2009-07-13 11:56:29
<?php /* Smarty version 2.6.16, created on 2009-10-05 13:50:52
compiled from index.tpl */ ?>
<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "header.tpl", 'smarty_include_vars' => array()));


+ 1
- 1
trunk/data/%%F7^F7F^F7F34188%%header.tpl.php Parādīt failu

@@ -1,4 +1,4 @@
<?php /* Smarty version 2.6.16, created on 2009-07-13 11:56:29
<?php /* Smarty version 2.6.16, created on 2009-10-05 13:50:52
compiled from header.tpl */ ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">


+ 11
- 6
trunk/docs/include/scraper_support.php Parādīt failu

@@ -297,15 +297,20 @@ function scrape_applications_islington ($search_url, $info_url_base, $comment_ur
$clean_postcode = strtolower($postcode);
$clean_postcode = str_replace(" ","+", $clean_postcode);

$url = "http://www.streetmap.co.uk/newsearch.srf?type=Postcode&name=" . $clean_postcode;
$url = "http://ernestmarples.com/?p=sw98jx&f=csv";
$result = file_get_contents($url);
$result = split(",", $result);
if(count($result) != 2){
trigger_error("No lat/long could be found");
}
$lat = $result[0];
$lng = $result[1];

$headers = get_headers($url, 1);
$location = $headers["Location"];
$location_regex = "/x=(\d*)&y=(\d*)&/";
$LatLng = new LatLng($lat, $lng);
$OSBG = $LatLng->toOSRef();

preg_match ($location_regex, $location, $matches);
$return = array($OSBG->easting, $OSBG->northing);

return array_slice ($matches, 1);
}
function location_to_postcode($easting, $northing) {


+ 16
- 7
trunk/docs/preview.php Parādīt failu

@@ -32,17 +32,26 @@ class preview_page {
if (!isset($_GET['area_size'])){
$this->warnings .= "No area size specified ";
}
if ($this->warnings == ""){

if ($this->warnings == ""){
$url = "http://ernestmarples.com/?p=sw98jx&f=csv";
$result = file_get_contents($url);
$result = split(",", $result);
if(count($result) != 2){
trigger_error("No lat/long could be found");
}
$lat = $result[0];
$lng = $result[1];

//Get OS ref from postcode
$xy = postcode_to_location($_GET['postcode']);

//Get the centroid long / lat (google maps doesnt handle grid refs)
$os_ref = new OSRef($xy[0], $xy[1]);
$long_lat = $os_ref->toLatLng();
$this->center_long = $long_lat->lng;
$this->center_lat = $long_lat->lat;
//$os_ref = new OSRef($xy[0], $xy[1]);
//$long_lat = $os_ref->toLatLng();
$this->center_long = $lng; //$long_lat->lng;
$this->center_lat = $lat; //$long_lat->lat;
//get long lat for the bounding box (OS grid refs are in meters in case you were wondering)


Notiek ielāde…
Atcelt
Saglabāt