Example #1
0
    $search_result_ids[] = 0;
    if ($wp_query->posts) {
        foreach ($wp_query->posts as $p) {
            $search_result_ids[] = $p->ID . '';
        }
    }
    $term_heading = __('Searching for ', 'appthemes') . '“' . $search . '” ';
}
if ($location) {
    // Get address from post data
    $address_array = '';
    if (isset($_REQUEST['latitude']) && $_REQUEST['latitude'] && $_REQUEST['longitude'] && $_REQUEST['full_address']) {
        $address_array = array('north_east_lng' => trim(stripslashes($_REQUEST['north_east_lng'])), 'south_west_lng' => trim(stripslashes($_REQUEST['south_west_lng'])), 'north_east_lat' => trim(stripslashes($_REQUEST['north_east_lat'])), 'south_west_lat' => trim(stripslashes($_REQUEST['south_west_lat'])), 'longitude' => trim(stripslashes($_REQUEST['longitude'])), 'latitude' => trim(stripslashes($_REQUEST['latitude'])), 'full_address' => trim(stripslashes($_REQUEST['full_address'])));
    }
    // Do radial search
    $radial_result = jr_radial_search($location, $radius, $address_array);
    if (is_array($radial_result)) {
        if ($radial_result['address']) {
            $location = $radial_result['address'];
        }
        $find_posts_in = $radial_result['posts'];
    }
    if (get_option('jr_distance_unit') == 'km') {
        $format = __('Jobs within %s kilometers of %s', 'appthemes');
    } else {
        $format = __('Jobs within %s miles of %s', 'appthemes');
    }
    $location_heading = sprintf($format, $radius, $location);
}
if (!$term_heading && !$location_heading) {
    $term_heading = __('Search Results', 'appthemes');
Example #2
0
global $wp_query, $query_string;
$term_heading = '';
$find_posts_in = '';
$search = get_search_query();
$location = isset($_GET['location']) ? trim($_GET['location']) : '';
$radius = isset($_GET['radius']) ? absint($_GET['radius']) : 0;
if (!$radius) {
    $radius = 50;
}
if ($search) {
    $term_heading = sprintf(__('Searching resumes for “%s” ', 'appthemes'), get_search_query());
} else {
    $term_heading = __('Searching resumes ', 'appthemes');
}
if ($location) {
    $radial_result = jr_radial_search($location, $radius);
    if (is_array($radial_result)) {
        if ($radial_result['address']) {
            $location = $radial_result['address'];
        }
        $find_posts_in = $radial_result['posts'];
    }
    $term_heading .= __('within ', 'appthemes') . ' ' . $radius;
    if (get_option('jr_distance_unit') == 'km') {
        $term_heading .= 'km ';
    } else {
        $term_heading .= ' Miles ';
    }
    $term_heading .= __('of', 'appthemes') . ' ' . ucwords($location);
    $find_posts_in[] = 0;
}