Ejemplo n.º 1
0
     $smarty->assign('long', $long);
     $smarty->assign_by_ref('square', $square);
     //get a token to show a suroudding geograph map
     $mosaic = new GeographMapMosaic();
     $smarty->assign('map_token', $mosaic->getGridSquareToken($square));
     if ($CONF['forums']) {
         $square->assignDiscussionToSmarty($smarty);
     }
     if (!empty($CONF['sphinx_host'])) {
         //look for images from here...
         $sphinx = new sphinxwrapper();
         if (!isset($viewpoint_count) && ($viewpoint_count = $sphinx->countImagesViewpoint($square->nateastings, $square->natnorthings, $square->reference_index, $square->grid_reference))) {
             $smarty->assign('viewpoint_count', $viewpoint_count);
             #$smarty->assign('viewpoint_query', $sphinx->q);
         }
         if (!isset($mention_count) && ($mention_count = $sphinx->countQuery("{$square->grid_reference} -grid_reference:{$square->grid_reference}", "_images"))) {
             $smarty->assign('mention_count', $mention_count);
         }
     }
     if ($square->natspecified && $square->natgrlen >= 6) {
         $conv = new Conversions('');
         list($gr6, $len) = $conv->national_to_gridref($square->getNatEastings(), $square->getNatNorthings(), 6, $square->reference_index, false);
         $smarty->assign('gridref6', $gr6);
     }
 } else {
     $smarty->assign('errormsg', $square->errormsg);
     //includes a closest match?
     if (is_object($square->nearest)) {
         $smarty->assign('nearest_distance', $square->nearest->distance);
         $smarty->assign('nearest_gridref', $square->nearest->grid_reference);
         if (!empty($square->x) && !empty($square->y) && $square->nearest->distance < 15) {