Exemplo n.º 1
0
 function widget($args, $instance)
 {
     global $posty_plugin_url;
     $geoPosty = getGeoPosty();
     if (!empty($instance['distancefrom']) && $instance['miles'] > 1) {
         if ($instance['reverse'] && geoDistanceFrom($instance['distancefrom']) < $instance['miles']) {
             return false;
         } elseif (!$instance['reverse'] && geoDistanceFrom($instance['distancefrom']) > $instance['miles']) {
             return false;
         }
     }
     $locationTest = geoLocationContent($instance['locationtype'], $instance['location'], $instance['reverse']);
     if (!$locationTest) {
         return false;
     }
     recordGeoStats('w_business');
     extract($args, EXTR_SKIP);
     echo $args['before_widget'];
     echo $args['before_title'] . do_shortcode(stripslashes($instance['title'])) . $args['after_title'];
     echo '<div id="geoGoogleBusiness"></div>';
     echo '<script type="text/javascript"> googleBusinessSearch(' . $geoPosty['Latitude'] . ', ' . $geoPosty['Longitude'] . ', \'' . $instance['search'] . '\', \'' . $instance['results'] . '\');  </script>';
     //boo-urns
     echo $args['after_widget'];
 }
Exemplo n.º 2
0
function geoLongitude()
{
    recordGeoStats('lon');
    $geoPosty = getGeoPosty();
    if ($geoPosty) {
        return $geoPosty['Longitude'];
    } else {
        return 'your longitude';
    }
}