Test Failed
Push — master ( c1df28...a05170 )
by Stiofan
15:12
created
geodirectory-functions/compatibility/Avada.php 1 patch
Indentation   +105 added lines, -105 removed lines patch added patch discarded remove patch
@@ -18,10 +18,10 @@  discard block
 block discarded – undo
18 18
  */
19 19
 function gd_strip_breadcrumb_wrappers($breadcrumb)
20 20
 {
21
-    $breadcrumb = str_replace(array("<li>","</li>"), "", $breadcrumb);
22
-    $breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '<ul class="fusion-breadcrumbs"><li>', $breadcrumb);
23
-    $breadcrumb = str_replace('</ul></div>', '</li></ul>', $breadcrumb);
24
-    return $breadcrumb;
21
+	$breadcrumb = str_replace(array("<li>","</li>"), "", $breadcrumb);
22
+	$breadcrumb = str_replace('<div class="geodir-breadcrumb clearfix"><ul id="breadcrumbs">', '<ul class="fusion-breadcrumbs"><li>', $breadcrumb);
23
+	$breadcrumb = str_replace('</ul></div>', '</li></ul>', $breadcrumb);
24
+	return $breadcrumb;
25 25
 }
26 26
 
27 27
 add_filter('geodir_breadcrumb_separator', 'gd_change_breadcrumb_separator');
@@ -35,8 +35,8 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function gd_change_breadcrumb_separator($separator)
37 37
 {
38
-    $separator = ' / ';
39
-    return $separator;
38
+	$separator = ' / ';
39
+	return $separator;
40 40
 }
41 41
 
42 42
 add_action('avada_override_current_page_title_bar','gd_avada_current_page_title_bar_change');
@@ -49,11 +49,11 @@  discard block
 block discarded – undo
49 49
  */
50 50
 function gd_avada_current_page_title_bar_change($c_pageID)
51 51
 {
52
-    if (geodir_is_geodir_page()) {
53
-        gd_avada_current_page_title_bar();
54
-    }else{
55
-        avada_current_page_title_bar( $c_pageID );
56
-    }
52
+	if (geodir_is_geodir_page()) {
53
+		gd_avada_current_page_title_bar();
54
+	}else{
55
+		avada_current_page_title_bar( $c_pageID );
56
+	}
57 57
 
58 58
 }
59 59
 
@@ -65,46 +65,46 @@  discard block
 block discarded – undo
65 65
  */
66 66
 function gd_avada_current_page_title_bar()
67 67
 {
68
-    ob_start();
69
-    geodir_breadcrumb();
70
-    $secondary_content = ob_get_contents();
71
-    ob_get_clean();
72
-
73
-    $title = '';
74
-    $subtitle = '';
75
-
76
-    if (geodir_is_page('listing')) {
77
-        ob_start(); // Start buffering;
78
-        geodir_action_listings_title();
79
-        $title = ob_get_clean();
80
-        avada_page_title_bar($title, $subtitle, $secondary_content);
81
-    }
82
-
83
-    if (geodir_is_page('add-listing')) {
84
-        ob_start(); // Start buffering;
85
-        geodir_action_add_listing_page_title();
86
-        $title = ob_get_clean();
87
-        avada_page_title_bar($title, $subtitle, $secondary_content);
88
-    }
89
-
90
-    if (geodir_is_page('author')) {
91
-        ob_start(); // Start buffering;
92
-        geodir_action_author_page_title();
93
-        $title = ob_get_clean();
94
-        avada_page_title_bar($title, $subtitle, $secondary_content);
95
-    }
96
-
97
-    if (geodir_is_page('detail') || geodir_is_page('preview')) {
98
-        $title = get_the_title();
99
-        avada_page_title_bar($title, $subtitle, $secondary_content);
100
-    }
101
-
102
-    if (geodir_is_page('search')) {
103
-        ob_start(); // Start buffering;
104
-        geodir_action_search_page_title();
105
-        $title = ob_get_clean();
106
-        avada_page_title_bar($title, $subtitle, $secondary_content);
107
-    }
68
+	ob_start();
69
+	geodir_breadcrumb();
70
+	$secondary_content = ob_get_contents();
71
+	ob_get_clean();
72
+
73
+	$title = '';
74
+	$subtitle = '';
75
+
76
+	if (geodir_is_page('listing')) {
77
+		ob_start(); // Start buffering;
78
+		geodir_action_listings_title();
79
+		$title = ob_get_clean();
80
+		avada_page_title_bar($title, $subtitle, $secondary_content);
81
+	}
82
+
83
+	if (geodir_is_page('add-listing')) {
84
+		ob_start(); // Start buffering;
85
+		geodir_action_add_listing_page_title();
86
+		$title = ob_get_clean();
87
+		avada_page_title_bar($title, $subtitle, $secondary_content);
88
+	}
89
+
90
+	if (geodir_is_page('author')) {
91
+		ob_start(); // Start buffering;
92
+		geodir_action_author_page_title();
93
+		$title = ob_get_clean();
94
+		avada_page_title_bar($title, $subtitle, $secondary_content);
95
+	}
96
+
97
+	if (geodir_is_page('detail') || geodir_is_page('preview')) {
98
+		$title = get_the_title();
99
+		avada_page_title_bar($title, $subtitle, $secondary_content);
100
+	}
101
+
102
+	if (geodir_is_page('search')) {
103
+		ob_start(); // Start buffering;
104
+		geodir_action_search_page_title();
105
+		$title = ob_get_clean();
106
+		avada_page_title_bar($title, $subtitle, $secondary_content);
107
+	}
108 108
 }
109 109
 
110 110
 /**
@@ -115,34 +115,34 @@  discard block
 block discarded – undo
115 115
  */
116 116
 function gd_compat_php_avada()
117 117
 {
118
-    // change widget wrappers
119
-    //add_filter( 'geodir_before_widget', 'geodir_before_widget_compat',10,1 );
120
-    //add_filter( 'geodir_after_widget', 'geodir_after_widget_compat',10,1 );
121
-
122
-    // REMOVE BREADCRUMB
123
-    remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
124
-    remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
125
-    remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
126
-    remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
127
-    remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
128
-    remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
129
-
130
-    // REMOVE PAGE TITLES
131
-    remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
132
-    remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
133
-    remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
134
-    remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
135
-    remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
136
-
137
-    // make top section wide
138
-    remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
139
-    remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
140
-    remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
141
-    remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
142
-    remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
143
-    remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
144
-
145
-    //gd_compat_add_top_section_back();
118
+	// change widget wrappers
119
+	//add_filter( 'geodir_before_widget', 'geodir_before_widget_compat',10,1 );
120
+	//add_filter( 'geodir_after_widget', 'geodir_after_widget_compat',10,1 );
121
+
122
+	// REMOVE BREADCRUMB
123
+	remove_action('geodir_detail_before_main_content', 'geodir_breadcrumb', 20);
124
+	remove_action('geodir_listings_before_main_content', 'geodir_breadcrumb', 20);
125
+	remove_action('geodir_author_before_main_content', 'geodir_breadcrumb', 20);
126
+	remove_action('geodir_search_before_main_content', 'geodir_breadcrumb', 20);
127
+	remove_action('geodir_home_before_main_content', 'geodir_breadcrumb', 20);
128
+	remove_action('geodir_location_before_main_content', 'geodir_breadcrumb', 20);
129
+
130
+	// REMOVE PAGE TITLES
131
+	remove_action('geodir_listings_page_title', 'geodir_action_listings_title', 10);
132
+	remove_action('geodir_add_listing_page_title', 'geodir_action_add_listing_page_title', 10);
133
+	remove_action('geodir_details_main_content', 'geodir_action_page_title', 20);
134
+	remove_action('geodir_search_page_title', 'geodir_action_search_page_title', 10);
135
+	remove_action('geodir_author_page_title', 'geodir_action_author_page_title', 10);
136
+
137
+	// make top section wide
138
+	remove_action('geodir_home_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
139
+	remove_action('geodir_location_before_main_content', 'geodir_action_geodir_sidebar_home_top', 10);
140
+	remove_action('geodir_author_before_main_content', 'geodir_action_geodir_sidebar_author_top', 10);
141
+	remove_action('geodir_search_before_main_content', 'geodir_action_geodir_sidebar_search_top', 10);
142
+	remove_action('geodir_detail_before_main_content', 'geodir_action_geodir_sidebar_detail_top', 10);
143
+	remove_action('geodir_listings_before_main_content', 'geodir_action_geodir_sidebar_listings_top', 10);
144
+
145
+	//gd_compat_add_top_section_back();
146 146
 
147 147
 }
148 148
 
@@ -156,17 +156,17 @@  discard block
 block discarded – undo
156 156
 function gd_compat_add_top_section_back()
157 157
 {
158 158
 
159
-    if (is_page_geodir_home() || geodir_is_page('location')) {
160
-        geodir_action_geodir_sidebar_home_top();
161
-    } elseif (geodir_is_page('listing')) {
162
-        geodir_action_geodir_sidebar_listings_top();
163
-    } elseif (geodir_is_page('detail')) {
164
-        geodir_action_geodir_sidebar_detail_top();
165
-    } elseif (geodir_is_page('search')) {
166
-        geodir_action_geodir_sidebar_search_top();
167
-    } elseif (geodir_is_page('author')) {
168
-        geodir_action_geodir_sidebar_author_top();
169
-    }
159
+	if (is_page_geodir_home() || geodir_is_page('location')) {
160
+		geodir_action_geodir_sidebar_home_top();
161
+	} elseif (geodir_is_page('listing')) {
162
+		geodir_action_geodir_sidebar_listings_top();
163
+	} elseif (geodir_is_page('detail')) {
164
+		geodir_action_geodir_sidebar_detail_top();
165
+	} elseif (geodir_is_page('search')) {
166
+		geodir_action_geodir_sidebar_search_top();
167
+	} elseif (geodir_is_page('author')) {
168
+		geodir_action_geodir_sidebar_author_top();
169
+	}
170 170
 
171 171
 
172 172
 }
@@ -183,12 +183,12 @@  discard block
 block discarded – undo
183 183
  */
184 184
 function gd_compat_body_class($classes)
185 185
 {
186
-    if (geodir_is_geodir_page()) {
187
-        $classes[] = 'wpgeo-avada';
188
-    } else {
189
-        $classes[] = '';
190
-    }
191
-    return $classes;
186
+	if (geodir_is_geodir_page()) {
187
+		$classes[] = 'wpgeo-avada';
188
+	} else {
189
+		$classes[] = '';
190
+	}
191
+	return $classes;
192 192
 }
193 193
 
194 194
 
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
  */
203 203
 function geodir_before_widget_compat($var)
204 204
 {
205
-    return '<div id="%1$s" class="geodir-widget %2$s">';
205
+	return '<div id="%1$s" class="geodir-widget %2$s">';
206 206
 }
207 207
 
208 208
 /**
@@ -215,7 +215,7 @@  discard block
 block discarded – undo
215 215
  */
216 216
 function geodir_after_widget_compat($var)
217 217
 {
218
-    return '</div>';
218
+	return '</div>';
219 219
 }
220 220
 
221 221
 add_filter('geodir_search_form_class', 'geodir_search_form_class_avada');
@@ -229,8 +229,8 @@  discard block
 block discarded – undo
229 229
  */
230 230
 function geodir_search_form_class_avada($class)
231 231
 {
232
-    $class .= ' search';
233
-    return $class;
232
+	$class .= ' search';
233
+	return $class;
234 234
 }
235 235
 
236 236
 
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
 
240 240
 // Avada sets the search page to use wither post or page, we need it to be 'any'
241 241
 function gd_avada_search_filter( $query ) {
242
-    if ( geodir_is_page('search') && is_search() && $query->is_search) {
243
-            $query->set('post_type', 'any');
244
-    }
245
-    return $query;
242
+	if ( geodir_is_page('search') && is_search() && $query->is_search) {
243
+			$query->set('post_type', 'any');
244
+	}
245
+	return $query;
246 246
 }
247 247
 if ( ! is_admin() ) {
248
-    add_filter( 'pre_get_posts', 'gd_avada_search_filter',11 );
248
+	add_filter( 'pre_get_posts', 'gd_avada_search_filter',11 );
249 249
 }
250 250
\ No newline at end of file
Please login to merge, or discard this patch.
geodirectory_template_tags.php 1 patch
Indentation   +343 added lines, -343 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
  */
23 23
 function geodir_core_dequeue_script()
24 24
 {
25
-    wp_dequeue_script('flexslider');
25
+	wp_dequeue_script('flexslider');
26 26
 }
27 27
 
28 28
 add_action('wp_print_scripts', 'geodir_core_dequeue_script', 100);
@@ -35,158 +35,158 @@  discard block
 block discarded – undo
35 35
  */
36 36
 function geodir_templates_scripts()
37 37
 {
38
-    $is_detail_page = false;
39
-    $geodir_map_name = geodir_map_name();
40
-
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
-        $is_detail_page = true;
43
-    }
44
-
45
-    wp_enqueue_script('jquery');
46
-
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
-    wp_enqueue_script('geodirectory-script');
49
-
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56
-    );
57
-
58
-    /**
59
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
60
-     *
61
-     * This is used by addons to add JS translatable variables.
62
-     *
63
-     * @since 1.4.4
64
-     * @param array $geodir_vars_data {
65
-     *    geodir var data used by addons to add JS translatable variables.
66
-     *
67
-     *    @type string $siteurl Site url.
68
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
69
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
70
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
71
-     *    @type int $is_rtl Checks if current locale is RTL.
72
-     *
73
-     * }
74
-     */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
-
77
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78
-
79
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
81
-
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
-    wp_enqueue_script('geodirectory-lightbox-jquery');
84
-
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
-    if ($is_detail_page) {
87
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
88
-    }
89
-
90
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
91
-        $map_lang = "&language=" . geodir_get_map_default_language();
92
-        /**
93
-         * Filter the variables that are added to the end of the google maps script call.
94
-         *
95
-         * This i used to change things like google maps language etc.
96
-         *
97
-         * @since 1.0.0
98
-         * @param string $var The string to filter, default is empty string.
99
-         */
100
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
-        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
-    }
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40
+
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
44
+
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48
+	wp_enqueue_script('geodirectory-script');
49
+
50
+	$geodir_vars_data = array(
51
+		'siteurl' => get_option('siteurl'),
52
+		'geodir_plugin_url' => geodir_plugin_url(),
53
+		'geodir_ajax_url' => geodir_get_ajax_url(),
54
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56
+	);
57
+
58
+	/**
59
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
60
+	 *
61
+	 * This is used by addons to add JS translatable variables.
62
+	 *
63
+	 * @since 1.4.4
64
+	 * @param array $geodir_vars_data {
65
+	 *    geodir var data used by addons to add JS translatable variables.
66
+	 *
67
+	 *    @type string $siteurl Site url.
68
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
69
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
70
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
71
+	 *    @type int $is_rtl Checks if current locale is RTL.
72
+	 *
73
+	 * }
74
+	 */
75
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+
77
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78
+
79
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
80
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
81
+
82
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+	wp_enqueue_script('geodirectory-lightbox-jquery');
84
+
85
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+	if ($is_detail_page) {
87
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
88
+	}
89
+
90
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
91
+		$map_lang = "&language=" . geodir_get_map_default_language();
92
+		/**
93
+		 * Filter the variables that are added to the end of the google maps script call.
94
+		 *
95
+		 * This i used to change things like google maps language etc.
96
+		 *
97
+		 * @since 1.0.0
98
+		 * @param string $var The string to filter, default is empty string.
99
+		 */
100
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
101
+		wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?' . $map_lang . $map_extra, '', NULL);
102
+	}
103 103
     
104
-    if ($geodir_map_name == 'osm') {
105
-        // Leaflet OpenStreetMap
106
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
-        wp_enqueue_style('geodirectory-leaflet-style');
104
+	if ($geodir_map_name == 'osm') {
105
+		// Leaflet OpenStreetMap
106
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107
+		wp_enqueue_style('geodirectory-leaflet-style');
108 108
             
109
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
-        wp_enqueue_script('geodirectory-leaflet-script');
109
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110
+		wp_enqueue_script('geodirectory-leaflet-script');
111 111
         
112
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
114
-    }
115
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
112
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
114
+	}
115
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
116 116
     
117
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
-    wp_enqueue_script('geodirectory-goMap-script');
119
-
120
-
121
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
-    wp_enqueue_script('chosen');
123
-
124
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
-    wp_enqueue_script('geodirectory-choose-ajax');
126
-
127
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
-
129
-    if (is_page() && geodir_is_page('add-listing')) {
130
-        // SCRIPT FOR UPLOAD
131
-        wp_enqueue_script('plupload-all');
132
-        wp_enqueue_script('jquery-ui-sortable');
133
-
134
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
-        wp_enqueue_script('geodirectory-plupload-script');
136
-        // SCRIPT FOR UPLOAD END
137
-
138
-        // check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
139
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
140
-            $ajax_url = admin_url('admin-ajax.php');
141
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
142
-            $ajax_url = admin_url('admin-ajax.php');
143
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
145
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
146
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
147
-        } else {
148
-            $ajax_url = admin_url('admin-ajax.php');
149
-        }
117
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
118
+	wp_enqueue_script('geodirectory-goMap-script');
119
+
120
+
121
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122
+	wp_enqueue_script('chosen');
123
+
124
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125
+	wp_enqueue_script('geodirectory-choose-ajax');
126
+
127
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js#asyncload', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
128
+
129
+	if (is_page() && geodir_is_page('add-listing')) {
130
+		// SCRIPT FOR UPLOAD
131
+		wp_enqueue_script('plupload-all');
132
+		wp_enqueue_script('jquery-ui-sortable');
133
+
134
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
135
+		wp_enqueue_script('geodirectory-plupload-script');
136
+		// SCRIPT FOR UPLOAD END
137
+
138
+		// check_ajax_referer function is used to make sure no files are uplaoded remotly but it will fail if used between https and non https so we do the check below of the urls
139
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
140
+			$ajax_url = admin_url('admin-ajax.php');
141
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
142
+			$ajax_url = admin_url('admin-ajax.php');
143
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
144
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
145
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
146
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
147
+		} else {
148
+			$ajax_url = admin_url('admin-ajax.php');
149
+		}
150 150
 
151
-        // place js config array for plupload
152
-        $plupload_init = array(
153
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
154
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
155
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
156
-            'drop_element' => 'dropbox', // will be adjusted per uploader
157
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
158
-            'multiple_queues' => true,
159
-            'max_file_size' => geodir_max_upload_size(),
160
-            'url' => $ajax_url,
161
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
162
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
163
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
164
-            'multipart' => true,
165
-            'urlstream_upload' => true,
166
-            'multi_selection' => false, // will be added per uploader
167
-            // additional post data to send to our ajax hook
168
-            'multipart_params' => array(
169
-                '_ajax_nonce' => "", // will be added per uploader
170
-                'action' => 'plupload_action', // the ajax action name
171
-                'imgid' => 0 // will be added per uploader
172
-            )
173
-        );
174
-        $base_plupload_config = json_encode($plupload_init);
175
-
176
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
177
-            'upload_img_size' => geodir_max_upload_size());
178
-
179
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180
-
181
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
-    } // End if for add place page
183
-
184
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
-    if ($is_detail_page) {
151
+		// place js config array for plupload
152
+		$plupload_init = array(
153
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
154
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
155
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
156
+			'drop_element' => 'dropbox', // will be adjusted per uploader
157
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
158
+			'multiple_queues' => true,
159
+			'max_file_size' => geodir_max_upload_size(),
160
+			'url' => $ajax_url,
161
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
162
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
163
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
164
+			'multipart' => true,
165
+			'urlstream_upload' => true,
166
+			'multi_selection' => false, // will be added per uploader
167
+			// additional post data to send to our ajax hook
168
+			'multipart_params' => array(
169
+				'_ajax_nonce' => "", // will be added per uploader
170
+				'action' => 'plupload_action', // the ajax action name
171
+				'imgid' => 0 // will be added per uploader
172
+			)
173
+		);
174
+		$base_plupload_config = json_encode($plupload_init);
175
+
176
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
177
+			'upload_img_size' => geodir_max_upload_size());
178
+
179
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180
+
181
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
182
+	} // End if for add place page
183
+
184
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185
+	if ($is_detail_page) {
186 186
 		wp_enqueue_script('geodirectory-post-custom-js');
187 187
 	}
188 188
 
189
-    // font awesome rating script
189
+	// font awesome rating script
190 190
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
191 191
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
192 192
 		wp_enqueue_script('geodir-barrating-js');
@@ -195,11 +195,11 @@  discard block
 block discarded – undo
195 195
 		wp_enqueue_script('geodir-jRating-js');
196 196
 	}
197 197
 
198
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
-    wp_enqueue_script('geodir-on-document-load');
198
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199
+	wp_enqueue_script('geodir-on-document-load');
200 200
 
201
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
-    wp_enqueue_script('google-geometa');
201
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202
+	wp_enqueue_script('google-geometa');
203 203
 }
204 204
 
205 205
 /**
@@ -213,8 +213,8 @@  discard block
 block discarded – undo
213 213
  */
214 214
 function geodir_header_scripts()
215 215
 {
216
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
-    echo stripslashes(get_option('geodir_header_scripts'));
216
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
217
+	echo stripslashes(get_option('geodir_header_scripts'));
218 218
 }
219 219
 
220 220
 
@@ -230,7 +230,7 @@  discard block
 block discarded – undo
230 230
 function geodir_footer_scripts()
231 231
 {	
232 232
 	echo stripslashes(get_option('geodir_ga_tracking_code'));
233
-    echo stripslashes(get_option('geodir_footer_scripts'));
233
+	echo stripslashes(get_option('geodir_footer_scripts'));
234 234
 }
235 235
 
236 236
 
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
  */
245 245
 function geodir_add_async_forscript($url)
246 246
 {
247
-    if (strpos($url, '#asyncload')===false)
248
-        return $url;
249
-    else if (is_admin())
250
-        return str_replace('#asyncload', '', $url);
251
-    else
252
-        return str_replace('#asyncload', '', $url)."' async='async";
247
+	if (strpos($url, '#asyncload')===false)
248
+		return $url;
249
+	else if (is_admin())
250
+		return str_replace('#asyncload', '', $url);
251
+	else
252
+		return str_replace('#asyncload', '', $url)."' async='async";
253 253
 }
254 254
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
255 255
 
@@ -263,55 +263,55 @@  discard block
 block discarded – undo
263 263
 {
264 264
 
265 265
 
266
-    if(get_option('geodir_scss_core')) {
266
+	if(get_option('geodir_scss_core')) {
267 267
 
268 268
 
269
-        wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270
-        wp_enqueue_style('geodirectory-frontend-style');
269
+		wp_register_style('geodirectory-frontend-style', geodir_plugin_url() . '/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270
+		wp_enqueue_style('geodirectory-frontend-style');
271 271
 
272
-        wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273
-        wp_enqueue_style('geodirectory-media-style');
272
+		wp_register_style('geodirectory-media-style', geodir_plugin_url() . '/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273
+		wp_enqueue_style('geodirectory-media-style');
274 274
 
275 275
 
276
-        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277
-        wp_enqueue_style('geodirectory-jquery-ui-css');
276
+		wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277
+		wp_enqueue_style('geodirectory-jquery-ui-css');
278 278
 
279
-        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280
-        wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
279
+		wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280
+		wp_enqueue_style('geodirectory-jquery-ui-timepicker-css');
281 281
 
282
-        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283
-        wp_enqueue_style('geodirectory-flexslider-css');
282
+		wp_register_style('geodirectory-flexslider-css', geodir_plugin_url() . '/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283
+		wp_enqueue_style('geodirectory-flexslider-css');
284 284
 
285
-        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286
-        wp_enqueue_style('geodirectory-thic-box-css');
285
+		wp_register_style('geodirectory-thic-box-css', geodir_plugin_url() . '/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286
+		wp_enqueue_style('geodirectory-thic-box-css');
287 287
 
288
-        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289
-        wp_enqueue_style('geodirectory-pluplodar-css');
288
+		wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url() . '/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289
+		wp_enqueue_style('geodirectory-pluplodar-css');
290 290
 
291
-        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292
-        wp_enqueue_style('geodirectory-lightbox-css');
291
+		wp_register_style('geodirectory-lightbox-css', geodir_plugin_url() . '/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292
+		wp_enqueue_style('geodirectory-lightbox-css');
293 293
 
294
-        wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295
-        wp_enqueue_style('geodir-rating-style');
294
+		wp_register_style('geodir-rating-style', geodir_plugin_url() . '/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295
+		wp_enqueue_style('geodir-rating-style');
296 296
 
297
-        wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298
-        wp_enqueue_style('geodir-chosen-style');
297
+		wp_register_style('geodir-chosen-style', geodir_plugin_url() . '/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298
+		wp_enqueue_style('geodir-chosen-style');
299 299
 
300
-    }else{
301
-        wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302
-        wp_enqueue_style('geodir-core-scss');
300
+	}else{
301
+		wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302
+		wp_enqueue_style('geodir-core-scss');
303 303
 
304
-        wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
304
+		wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
305 305
 
306
-    }
306
+	}
307 307
 
308
-    if(is_rtl()){
309
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
311
-    }
308
+	if(is_rtl()){
309
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
310
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
311
+	}
312 312
 
313
-    wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
314
-    wp_enqueue_style('geodirectory-font-awesome');
313
+	wp_register_style('geodirectory-font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
314
+	wp_enqueue_style('geodirectory-font-awesome');
315 315
 
316 316
 
317 317
 }
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
  */
326 326
 function geodir_get_sidebar()
327 327
 {
328
-    get_sidebar('geodirectory');
328
+	get_sidebar('geodirectory');
329 329
 }
330 330
 
331 331
 /**
@@ -344,122 +344,122 @@  discard block
 block discarded – undo
344 344
  * @param bool $always_show Do you want to show the pagination always? Default: false.
345 345
  */
346 346
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
347
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
347
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
348 348
 
349
-    if (empty($prelabel)) {
350
-        $prelabel = '<strong>&laquo;</strong>';
351
-    }
349
+	if (empty($prelabel)) {
350
+		$prelabel = '<strong>&laquo;</strong>';
351
+	}
352 352
 
353
-    if (empty($nxtlabel)) {
354
-        $nxtlabel = '<strong>&raquo;</strong>';
355
-    }
353
+	if (empty($nxtlabel)) {
354
+		$nxtlabel = '<strong>&raquo;</strong>';
355
+	}
356 356
 
357
-    $half_pages_to_show = round($pages_to_show / 2);
357
+	$half_pages_to_show = round($pages_to_show / 2);
358 358
 
359
-    if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
360
-        return;
359
+	if (geodir_is_page('home') || (get_option('geodir_set_as_home') && is_home())) // dont apply default  pagination for geodirectory home page.
360
+		return;
361 361
 
362
-    if (!is_single()) {
363
-        if (function_exists('geodir_location_geo_home_link')) {
364
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
365
-        }
366
-        $numposts = $wp_query->found_posts;
362
+	if (!is_single()) {
363
+		if (function_exists('geodir_location_geo_home_link')) {
364
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
365
+		}
366
+		$numposts = $wp_query->found_posts;
367 367
 
368
-        $max_page = ceil($numposts / $posts_per_page);
368
+		$max_page = ceil($numposts / $posts_per_page);
369 369
 
370
-        if (empty($paged)) {
371
-            $paged = 1;
372
-        }
370
+		if (empty($paged)) {
371
+			$paged = 1;
372
+		}
373 373
         
374
-        $post_type = geodir_get_current_posttype();
375
-        $listing_type_name = get_post_type_plural_label($post_type);
376
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
377
-            $term = array();
374
+		$post_type = geodir_get_current_posttype();
375
+		$listing_type_name = get_post_type_plural_label($post_type);
376
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
377
+			$term = array();
378 378
             
379
-            if (is_tax()) {
380
-                $term_id = get_queried_object_id();
381
-                $taxonomy = get_query_var('taxonomy');
379
+			if (is_tax()) {
380
+				$term_id = get_queried_object_id();
381
+				$taxonomy = get_query_var('taxonomy');
382 382
 
383
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
-                    $term = get_term($term_id, $post_type . 'category');
385
-                }
386
-            }
383
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
384
+					$term = get_term($term_id, $post_type . 'category');
385
+				}
386
+			}
387 387
             
388
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
388
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
389
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
390 390
                 
391
-                if (!is_array($taxonomy_search)) {
392
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
393
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
395
-                }
396
-            }
391
+				if (!is_array($taxonomy_search)) {
392
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
393
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
394
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
395
+				}
396
+			}
397 397
             
398
-            if (!empty($term) && !is_wp_error($term)) {
399
-                $listing_type_name = $term->name;
400
-            }
401
-        }
398
+			if (!empty($term) && !is_wp_error($term)) {
399
+				$listing_type_name = $term->name;
400
+			}
401
+		}
402 402
 
403
-        if ($max_page > 1 || $always_show) {            
404
-            // Extra pagination info
405
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
407
-            $end_no = min($paged * $posts_per_page, $numposts);
403
+		if ($max_page > 1 || $always_show) {            
404
+			// Extra pagination info
405
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
407
+			$end_no = min($paged * $posts_per_page, $numposts);
408 408
 
409
-            if ($geodir_pagination_more_info != '') {
410
-                if ($listing_type_name) {
411
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
412
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
413
-                } else {
414
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415
-                }
416
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
417
-                /**
418
-                 * Adds an extra pagination info above/under pagination.
419
-                 *
420
-                 * @since 1.5.9
421
-                 *
422
-                 * @param string $pagination_info Extra pagination info content.
423
-                 * @param string $listing_type_name Listing results type.
424
-                 * @param string $start_no First result number.
425
-                 * @param string $end_no Last result number.
426
-                 * @param string $numposts Total number of listings.
427
-                 * @param string $post_type The post type.
428
-                 */
429
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
409
+			if ($geodir_pagination_more_info != '') {
410
+				if ($listing_type_name) {
411
+					$listing_type_name = __($listing_type_name, 'geodirectory');
412
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
413
+				} else {
414
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415
+				}
416
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
417
+				/**
418
+				 * Adds an extra pagination info above/under pagination.
419
+				 *
420
+				 * @since 1.5.9
421
+				 *
422
+				 * @param string $pagination_info Extra pagination info content.
423
+				 * @param string $listing_type_name Listing results type.
424
+				 * @param string $start_no First result number.
425
+				 * @param string $end_no Last result number.
426
+				 * @param string $numposts Total number of listings.
427
+				 * @param string $post_type The post type.
428
+				 */
429
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
430 430
                 
431
-                if ($geodir_pagination_more_info == 'before') {
432
-                    $before = $before . $pagination_info;
433
-                } else if ($geodir_pagination_more_info == 'after') {
434
-                    $after = $pagination_info . $after;
435
-                }
436
-            }
431
+				if ($geodir_pagination_more_info == 'before') {
432
+					$before = $before . $pagination_info;
433
+				} else if ($geodir_pagination_more_info == 'after') {
434
+					$after = $pagination_info . $after;
435
+				}
436
+			}
437 437
             
438
-            echo "$before <div class='Navi gd-navi'>";
439
-            if ($paged >= ($pages_to_show - 1)) {
440
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
441
-            }
442
-            previous_posts_link($prelabel);
443
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
444
-                if ($i >= 1 && $i <= $max_page) {
445
-                    if ($i == $paged) {
446
-                        echo "<strong class='on'>$i</strong>";
447
-                    } else {
448
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
449
-                    }
450
-                }
451
-            }
452
-            next_posts_link($nxtlabel, $max_page);
453
-            if (($paged + $half_pages_to_show) < ($max_page)) {
454
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
455
-            }
456
-            echo "</div> $after";
457
-        }
438
+			echo "$before <div class='Navi gd-navi'>";
439
+			if ($paged >= ($pages_to_show - 1)) {
440
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
441
+			}
442
+			previous_posts_link($prelabel);
443
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
444
+				if ($i >= 1 && $i <= $max_page) {
445
+					if ($i == $paged) {
446
+						echo "<strong class='on'>$i</strong>";
447
+					} else {
448
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
449
+					}
450
+				}
451
+			}
452
+			next_posts_link($nxtlabel, $max_page);
453
+			if (($paged + $half_pages_to_show) < ($max_page)) {
454
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
455
+			}
456
+			echo "</div> $after";
457
+		}
458 458
         
459
-        if (function_exists('geodir_location_geo_home_link')) {
460
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
461
-        }
462
-    }
459
+		if (function_exists('geodir_location_geo_home_link')) {
460
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
461
+		}
462
+	}
463 463
 }
464 464
 
465 465
 /**
@@ -470,20 +470,20 @@  discard block
 block discarded – undo
470 470
  */
471 471
 function geodir_listingsearch_scripts()
472 472
 {
473
-    if (get_option('gd_search_dist') != '') {
474
-        $dist = get_option('gd_search_dist');
475
-    } else {
476
-        $dist = 500;
477
-    }
478
-    $dist_dif = 1000;
479
-
480
-    if ($dist <= 5000) $dist_dif = 500;
481
-    if ($dist <= 1000) $dist_dif = 100;
482
-    if ($dist <= 500) $dist_dif = 50;
483
-    if ($dist <= 100) $dist_dif = 10;
484
-    if ($dist <= 50) $dist_dif = 5;
485
-
486
-    ?>
473
+	if (get_option('gd_search_dist') != '') {
474
+		$dist = get_option('gd_search_dist');
475
+	} else {
476
+		$dist = 500;
477
+	}
478
+	$dist_dif = 1000;
479
+
480
+	if ($dist <= 5000) $dist_dif = 500;
481
+	if ($dist <= 1000) $dist_dif = 100;
482
+	if ($dist <= 500) $dist_dif = 50;
483
+	if ($dist <= 100) $dist_dif = 10;
484
+	if ($dist <= 50) $dist_dif = 5;
485
+
486
+	?>
487 487
     <script type="text/javascript">
488 488
 
489 489
         jQuery(function ($) {
@@ -542,15 +542,15 @@  discard block
 block discarded – undo
542 542
 function geodir_add_sharelocation_scripts()
543 543
 {
544 544
 
545
-    $default_search_for_text = SEARCH_FOR_TEXT;
546
-    if (get_option('geodir_search_field_default_text'))
547
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
545
+	$default_search_for_text = SEARCH_FOR_TEXT;
546
+	if (get_option('geodir_search_field_default_text'))
547
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
548 548
 
549
-    $default_near_text = NEAR_TEXT;
550
-    if (get_option('geodir_near_field_default_text'))
551
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
549
+	$default_near_text = NEAR_TEXT;
550
+	if (get_option('geodir_near_field_default_text'))
551
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
552 552
 
553
-    ?>
553
+	?>
554 554
 
555 555
 
556 556
     <script type="text/javascript">
@@ -631,14 +631,14 @@  discard block
 block discarded – undo
631 631
                     initialise2();
632 632
                 } else {
633 633
                     <?php
634
-                    $near_add = get_option('geodir_search_near_addition');
635
-                    /**
636
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
637
-                     *
638
-                     * @since 1.0.0
639
-                     */
640
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
641
-                    ?>
634
+					$near_add = get_option('geodir_search_near_addition');
635
+					/**
636
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
637
+					 *
638
+					 * @since 1.0.0
639
+					 */
640
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
641
+					?>
642 642
                     if (window.gdMaps === 'google') {
643 643
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
644 644
                             function (results, status) {
@@ -741,30 +741,30 @@  discard block
 block discarded – undo
741 741
  */
742 742
 function geodir_show_badges_on_image($which, $post, $link)
743 743
 {
744
-    $return = '';
745
-    switch ($which) {
746
-        case 'featured':
747
-            /**
748
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
749
-             *
750
-             * @since 1.0.0
751
-             * @param object $post The post object.
752
-             * @param string $link The link to the post.
753
-             */
754
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
755
-            break;
756
-        case 'new' :
757
-            /**
758
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
759
-             *
760
-             * @since 1.0.0
761
-             * @param object $post The post object.
762
-             * @param string $link The link to the post.
763
-             */
764
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
765
-            break;
766
-
767
-    }
744
+	$return = '';
745
+	switch ($which) {
746
+		case 'featured':
747
+			/**
748
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
749
+			 *
750
+			 * @since 1.0.0
751
+			 * @param object $post The post object.
752
+			 * @param string $link The link to the post.
753
+			 */
754
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
755
+			break;
756
+		case 'new' :
757
+			/**
758
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
759
+			 *
760
+			 * @since 1.0.0
761
+			 * @param object $post The post object.
762
+			 * @param string $link The link to the post.
763
+			 */
764
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
765
+			break;
766
+
767
+	}
768 768
     
769
-    return $return;
769
+	return $return;
770 770
 }
Please login to merge, or discard this patch.