Exemplo n.º 1
0
 		$targetLocation = $targetUserInfo[0]['work_history'][0]['location'];
 	}*/
 $smarty->assign('uid2', $targetedFriendId);
 if ($targetLocation['city'] != NULL) {
     // Check distance between user and friend
     $composite = "";
     if ($_POST['apptab_location'] == NULL) {
         $composite = $userLocation['city'];
         if ($userLocation['state'] != NULL) {
             $composite = $composite . "," . $userLocation['state'];
         }
         $composite = $composite . "," . $userLocation['country'];
     } else {
         $composite = $userLocation;
     }
     $xml = get_geocode_xml($composite);
     $userLola = get_lola($composite);
     $smarty->assign('userHotel', str_replace(",", "/", $composite));
     if ($debug) {
         echo "{$composite} <br/>";
     }
     $composite = $targetLocation['city'];
     if ($targetLocation['country'] == "USA" && $targetLocation['state'] != NULL) {
         $composite = $composite . "," . $targetLocation['state'];
     }
     $composite = $composite . "," . $targetLocation['country'];
     $smarty->assign('targetHotel', str_replace(",", "/", $composite));
     $targetLola = get_lola($composite);
     $smarty->assign('targetLong', $targetLola[0]);
     $smarty->assign('targetLat', $targetLola[1]);
     $smarty->assign('userLong', $userLola[0]);
Exemplo n.º 2
0
function get_lola_xml($location)
{
    $xml = get_geocode_xml($location);
    //echo "<br/>Output:".strstr($output,"coordinates")."<br/>";
    // Get x, y of city
    $x = 0;
    $y = 0;
    $output = strstr($output, "coordinates");
    $output = substr(strstr($output, "["), 2);
    $x = substr($output, 0, strpos($output, ","));
    $y = substr(strstr($output, ", "), 2);
    $y = substr($y, 0, strpos($y, ","));
    return array($x, $y);
}