Đang Thực Hiện

Modify Buddypress Profile Search Page to sort by distance.

I have a buddypress installation that I am using locations in the profile. I need the search results to display the distance between the zip code searched for (I have a database with all zipcodes) and the latitude and longitude of the matching search results. I have a script that calculates the distance between longitude and latitude coordinants and it works when I use sample data, but need help pulling in the zipcode and lon and lat from the search and assigning the long and lat from the profile I have this NEARLY DONE but need help finishing. Then I need the page to SORT ACCORDING TO THE CLOSEST SEARCH RESULT and paginate the remaining results.

I am looking for someone to do this in the next couple hours, please do not respond if you can't work on it right away and if you can't talk on SKYPE.

<?php

require_once("[url removed, login to view]");

// Lookup the longitude and latitude from the profile data

$latitude1 = <?php bp_member_profile_data( 'field=Latitude' );?>; // lat from the profile

$longitude1 = <?php bp_member_profile_data( 'field=Longitude' );?>; //lon from profile

// needs to search for long & latitude from the search box into wp_zip

$latitude2 = "SELECT Latitude FROM wp_zip WHERE wp_zip='$zip' LIMIT 1"; // wp_zip is the zipcode table with lat & lon

$longitude2 = "SELECT Longitude FROM wp_zip WHERE wp_zip='$zip' LIMIT 1"; // wp_zip is the zipcode table with lat & lon

// Create coordinates

$originCoord = new Coordinate($latitude1, $longitude1);

$relativeCoord = new Coordinate($latitude2, $longitude2);

$distCalc = new DistanceWizard();

// Perform calculation

$dist = $distCalc->CalculateDistance($originCoord, $relativeCoord, Measurement::MILES);

// Use result in a way of your choosing

//echo "Distance from Patient's Zipcode: " . $dist; echo " Miles"

?>

Kỹ năng: AJAX, MySQL, PHP

Xem thêm: buddypress search distance, buddypress distance search, buddypress distance, distance search buddypress, buddypress profile search, buddypress zip code search, search profile distance buddypress, sort sort sort, profile php code, code search, buddypress sort distance, buddypress search zip code, buddypress profile search latitude, buddypress profile sort, sample profile, profile sample, zip code search, search zip code, profile database, php buddypress, modify code, measurement, longitude, latitude, data pulling

Về Bên Thuê:
( 11 nhận xét ) Rochester, United States

Mã Dự Án: #1019888

Đã trao cho:

godka

Hello, I can help.

$100 USD trong 2 ngày
(22 Đánh Giá)
5.6