1<?php
2require_once ('getWikiData.php');
3require_once ('getContinent.php');
4require_once ('getErrors.php');
5
6$locality = $_GET["locality"];
7
8if ($locality != 'undefined') {
9  $countyCode=$_GET["county"];
10  $q=$_GET["q"];
11  if (($countyCode != 'undefined' || $locality != $q) &&
12      ($countyCode != $locality )) {
13      $countryCode=$_GET["ctry"];
14      $topic=$_GET["p"];
15      //
16      // get Continent
17      list ($continent, $country) = getContinent($countryCode);
18
19      $html = '<h1> '.ucwords($topic).'</h1>';
20      $html .=  '<h2 class="indent">' . $locality . '</h2>';
21
22      $locality = convToFile($locality);
23      $county   = convToFile($countyCode);
24      $region   = convToFile($q);
25      $countryCode = strtolower($countryCode);
26
27      $namespace = $topic;
28      $path = $topic . ':earth:' . $continent . ':' . $countryCode . ':' . $region . ':' . $county . ':' . $locality;
29
30      $wikiData = pullInWikiData($path, $namespace, $topic);
31      if ($wikiData != '')
32        $html .= $wikiData;
33      else
34        $html .=  '<p>'. htmlentities($exploreErrors['editPg']['en'], ENT_NOQUOTES) . htmlentities($exploreErrors['ckBack']['en'], ENT_NOQUOTES) .'</p> ';
35      $html  .= '<br /><p><a href="doku.php?id='.$path.'"><input type="button" class="button" value="Go to Edit" title="Go To Edit" /></a></p>';
36      $html .= htmlentities($exploreErrors['update']['en'], ENT_NOQUOTES);
37  } else
38    $html = '<p>'. $exploreErrors['noMore']['en'] .'</p>';
39} else
40  $html = '<p>'. $exploreErrors['mtBotm']['en'] .'</p>';
41
42echo $html;
43?>