Ejemplo n.º 1
0
         $smarty->assign('nearest_distance', $square->nearest->distance);
         $smarty->assign('nearest_gridref', $square->nearest->grid_reference);
     }
     if ($square->percent_land > 0) {
         //find a possible place within 25km
         $smarty->assign('place', $place = $square->findNearestPlace(75000));
         $place_name = strip_tags(smarty_function_place(array('place' => $place)));
         $smarty->assign('meta_description', "Geograph currently has {$square->imagecount} photos in {$square->grid_reference}, {$place_name}");
     }
 }
 $smarty->assign('mode', 'normal');
 if ($grid_ok && !empty($CONF['sphinx_host']) && (isset($_GET['takenfrom']) || isset($_GET['mentioning']))) {
     $sphinx = new sphinxwrapper();
     $sphinx->pageSize = 15;
     if (isset($_GET['takenfrom'])) {
         $ids = $sphinx->returnIdsViewpoint($square->getNatEastings(), $square->getNatNorthings(), $square->reference_index, $square->grid_reference);
         $smarty->assign('viewpoint_query', $sphinx->q);
         $viewpoint_count = 0;
         //set this to zero to suppress the prompt!
         $smarty->assign('mode', 'takenfrom');
     } else {
         $sphinx->prepareQuery("{$square->grid_reference} -grid_reference:{$square->grid_reference}");
         $ids = $sphinx->returnIds(1, "_images");
         $smarty->assign('mode', 'mentioning');
         $mention_count = 0;
         //set this to zero to suppress the prompt!
     }
     if (!empty($ids) && count($ids)) {
         $images = new ImageList();
         $images->getImagesByIdList($ids);
         $square->totalimagecount = $sphinx->resultCount;