Passed
Pull Request — master (#244)
by Kiran
14:02
created
geodirectory_template_tags.php 2 patches
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'>";
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'>";
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.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -38,20 +38,20 @@  discard block
 block discarded – undo
38 38
     $is_detail_page = false;
39 39
     $geodir_map_name = geodir_map_name();
40 40
 
41
-    if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
41
+    if ((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview'))) {
42 42
         $is_detail_page = true;
43 43
     }
44 44
 
45 45
     wp_enqueue_script('jquery');
46 46
 
47
-    wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js#asyncload', array(), GEODIRECTORY_VERSION);
48 48
     wp_enqueue_script('geodirectory-script');
49 49
 
50 50
     $geodir_vars_data = array(
51 51
         'siteurl' => get_option('siteurl'),
52 52
         'geodir_plugin_url' => geodir_plugin_url(),
53 53
         'geodir_ajax_url' => geodir_get_ajax_url(),
54
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
54
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
55 55
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
56 56
     );
57 57
 
@@ -72,23 +72,23 @@  discard block
 block discarded – undo
72 72
      *
73 73
      * }
74 74
      */
75
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
75
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
76 76
 
77 77
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
78 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');}
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 81
 
82
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
82
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
83 83
     wp_enqueue_script('geodirectory-lightbox-jquery');
84 84
 
85
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
85
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
86 86
     if ($is_detail_page) {
87 87
         wp_enqueue_script('geodirectory-jquery-simplemodal');
88 88
     }
89 89
 
90 90
     if (in_array($geodir_map_name, array('auto', 'google'))) {
91
-        $map_lang = "&language=" . geodir_get_map_default_language();
91
+        $map_lang = "&language=".geodir_get_map_default_language();
92 92
         /**
93 93
          * Filter the variables that are added to the end of the google maps script call.
94 94
          *
@@ -98,40 +98,40 @@  discard block
 block discarded – undo
98 98
          * @param string $var The string to filter, default is empty string.
99 99
          */
100 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);
101
+        wp_enqueue_script('geodirectory-googlemap-script', '//maps.google.com/maps/api/js?'.$map_lang.$map_extra, '', NULL);
102 102
     }
103 103
     
104 104
     if ($geodir_map_name == 'osm') {
105 105
         // Leaflet OpenStreetMap
106
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
106
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
107 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);
109
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
110 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);
112
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
113 113
         wp_enqueue_script('geodirectory-leaflet-geo-script');
114 114
     }
115
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
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);
117
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
118 118
     wp_enqueue_script('geodirectory-goMap-script');
119 119
 
120 120
 
121
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
121
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
122 122
     wp_enqueue_script('chosen');
123 123
 
124
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
124
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
125 125
     wp_enqueue_script('geodirectory-choose-ajax');
126 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);
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 128
 
129 129
     if (is_page() && geodir_is_page('add-listing')) {
130 130
         // SCRIPT FOR UPLOAD
131 131
         wp_enqueue_script('plupload-all');
132 132
         wp_enqueue_script('jquery-ui-sortable');
133 133
 
134
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
134
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
135 135
         wp_enqueue_script('geodirectory-plupload-script');
136 136
         // SCRIPT FOR UPLOAD END
137 137
 
@@ -178,27 +178,27 @@  discard block
 block discarded – undo
178 178
 
179 179
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
180 180
 
181
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
181
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
182 182
     } // End if for add place page
183 183
 
184
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
184
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
185 185
     if ($is_detail_page) {
186 186
 		wp_enqueue_script('geodirectory-post-custom-js');
187 187
 	}
188 188
 
189 189
     // font awesome rating script
190 190
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
191
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
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');
193 193
 	} else { // default rating script
194
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
194
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
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);
198
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.js#asyncload', array(), GEODIRECTORY_VERSION, true);
199 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);
201
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
202 202
     wp_enqueue_script('google-geometa');
203 203
 }
204 204
 
@@ -213,7 +213,7 @@  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>';
216
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
217 217
     echo stripslashes(get_option('geodir_header_scripts'));
218 218
 }
219 219
 
@@ -244,7 +244,7 @@  discard block
 block discarded – undo
244 244
  */
245 245
 function geodir_add_async_forscript($url)
246 246
 {
247
-    if (strpos($url, '#asyncload')===false)
247
+    if (strpos($url, '#asyncload') === false)
248 248
         return $url;
249 249
     else if (is_admin())
250 250
         return str_replace('#asyncload', '', $url);
@@ -263,50 +263,50 @@  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);
269
+        wp_register_style('geodirectory-frontend-style', geodir_plugin_url().'/geodirectory-assets/css/style.css', array(), GEODIRECTORY_VERSION);
270 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);
272
+        wp_register_style('geodirectory-media-style', geodir_plugin_url().'/geodirectory-assets/css/media.css', array(), GEODIRECTORY_VERSION);
273 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);
276
+        wp_register_style('geodirectory-jquery-ui-css', geodir_plugin_url().'/geodirectory-assets/css/jquery-ui.css', array(), GEODIRECTORY_VERSION);
277 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);
279
+        wp_register_style('geodirectory-jquery-ui-timepicker-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.ui.timepicker.css', array(), GEODIRECTORY_VERSION);
280 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);
282
+        wp_register_style('geodirectory-flexslider-css', geodir_plugin_url().'/geodirectory-assets/css/flexslider.css', array(), GEODIRECTORY_VERSION);
283 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);
285
+        wp_register_style('geodirectory-thic-box-css', geodir_plugin_url().'/geodirectory-assets/css/thic-box.css', array(), GEODIRECTORY_VERSION);
286 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);
288
+        wp_register_style('geodirectory-pluplodar-css', geodir_plugin_url().'/geodirectory-assets/css/pluploader.css', array(), GEODIRECTORY_VERSION);
289 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);
291
+        wp_register_style('geodirectory-lightbox-css', geodir_plugin_url().'/geodirectory-assets/css/jquery.lightbox-0.5.css', array(), GEODIRECTORY_VERSION);
292 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);
294
+        wp_register_style('geodir-rating-style', geodir_plugin_url().'/geodirectory-assets/css/jRating.jquery.css', array(), GEODIRECTORY_VERSION);
295 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);
297
+        wp_register_style('geodir-chosen-style', geodir_plugin_url().'/geodirectory-assets/css/chosen.css', array(), GEODIRECTORY_VERSION);
298 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);
300
+    } else {
301
+        wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
302 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);
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 310
     wp_enqueue_style('geodirectory-frontend-rtl-style');
311 311
     }
312 312
 
@@ -380,18 +380,18 @@  discard block
 block discarded – undo
380 380
                 $term_id = get_queried_object_id();
381 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');
383
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
384
+                    $term = get_term($term_id, $post_type.'category');
385 385
                 }
386 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 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');
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 395
                 }
396 396
             }
397 397
             
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
         if ($max_page > 1 || $always_show) {            
404 404
             // Extra pagination info
405 405
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
406
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
406
+            $start_no = ($paged - 1) * $posts_per_page + 1;
407 407
             $end_no = min($paged * $posts_per_page, $numposts);
408 408
 
409 409
             if ($geodir_pagination_more_info != '') {
@@ -413,7 +413,7 @@  discard block
 block discarded – undo
413 413
                 } else {
414 414
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
415 415
                 }
416
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
416
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
417 417
                 /**
418 418
                  * Adds an extra pagination info above/under pagination.
419 419
                  *
@@ -429,15 +429,15 @@  discard block
 block discarded – undo
429 429
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
430 430
                 
431 431
                 if ($geodir_pagination_more_info == 'before') {
432
-                    $before = $before . $pagination_info;
432
+                    $before = $before.$pagination_info;
433 433
                 } else if ($geodir_pagination_more_info == 'after') {
434
-                    $after = $pagination_info . $after;
434
+                    $after = $pagination_info.$after;
435 435
                 }
436 436
             }
437 437
             
438 438
             echo "$before <div class='Navi'>";
439 439
             if ($paged >= ($pages_to_show - 1)) {
440
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
440
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
441 441
             }
442 442
             previous_posts_link($prelabel);
443 443
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -445,13 +445,13 @@  discard block
 block discarded – undo
445 445
                     if ($i == $paged) {
446 446
                         echo "<strong class='on'>$i</strong>";
447 447
                     } else {
448
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
448
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
449 449
                     }
450 450
                 }
451 451
             }
452 452
             next_posts_link($nxtlabel, $max_page);
453 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>';
454
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
455 455
             }
456 456
             echo "</div> $after";
457 457
         }
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
         jQuery(function ($) {
490 490
             $("#distance_slider").slider({
491 491
                 range: true,
492
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
492
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
493 493
                 min: 0,
494 494
                 max: <?php echo $dist; ?>,
495 495
                 step: <?php echo $dist_dif; ?>,
@@ -554,7 +554,7 @@  discard block
 block discarded – undo
554 554
 
555 555
 
556 556
     <script type="text/javascript">
557
-        var default_location = '<?php if($search_location = geodir_get_default_location())  echo $search_location->city ;?>';
557
+        var default_location = '<?php if ($search_location = geodir_get_default_location())  echo $search_location->city; ?>';
558 558
         var latlng;
559 559
         var address;
560 560
         var dist = 0;
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 				var $form = jQuery(this).closest('form');
568 568
 				
569 569
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
570
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
570
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
571 571
 				
572 572
 				// Disable location based search for disabled location post type.
573 573
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -581,7 +581,7 @@  discard block
 block discarded – undo
581 581
 					}
582 582
 				}
583 583
 				
584
-				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text;?>')) {
584
+				if (dist > 0 || (jQuery('select[name="sort_by"]').val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest') || (jQuery(".snear", $form).val() != '' && jQuery(".snear", $form).val() != '<?php echo $default_near_text; ?>')) {
585 585
 					geodir_setsearch($form);
586 586
 				} else {
587 587
 					jQuery(".snear", $form).val('');
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
         });
601 601
         
602 602
 		function geodir_setsearch($form) {
603
-			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text;?>')) jQuery(".snear", $form).val(default_location);
603
+			if ((dist > 0 || (jQuery('select[name="sort_by"]', $form).val() == 'nearest' || jQuery('select[name="sort_by"]', $form).val() == 'farthest')) && (jQuery(".snear", $form).val() == '' || jQuery(".snear", $form).val() == '<?php echo $default_near_text; ?>')) jQuery(".snear", $form).val(default_location);
604 604
 			geocodeAddress($form);
605 605
 		}
606 606
 
@@ -619,15 +619,15 @@  discard block
 block discarded – undo
619 619
             // Call the geocode function
620 620
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
621 621
 
622
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
623
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
622
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
623
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
624 624
                     jQuery(".snear", $form).val('');
625 625
                 }
626 626
                 jQuery($form).submit();
627 627
             } else {
628 628
                 var address = jQuery(".snear", $form).val();
629 629
 
630
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
630
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
631 631
                     initialise2();
632 632
                 } else {
633 633
                     <?php
@@ -640,12 +640,12 @@  discard block
 block discarded – undo
640 640
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
641 641
                     ?>
642 642
                     if (window.gdMaps === 'google') {
643
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
643
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
644 644
                             function (results, status) {
645 645
                                 if (status == google.maps.GeocoderStatus.OK) {
646 646
                                     updateSearchPosition(results[0].geometry.location, $form);
647 647
                                 } else {
648
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory');?>" + status);
648
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason:', 'geodirectory'); ?>" + status);
649 649
                                 }
650 650
                             });
651 651
                     } else if (window.gdMaps === 'osm') {
@@ -654,7 +654,7 @@  discard block
 block discarded – undo
654 654
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
655 655
                                     updateSearchPosition(geo, $form);
656 656
                                 } else {
657
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
657
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
658 658
                                 }
659 659
                             });
660 660
                     } else {
@@ -700,19 +700,19 @@  discard block
 block discarded – undo
700 700
             var msg;
701 701
             switch (err.code) {
702 702
                 case err.UNKNOWN_ERROR:
703
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
703
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
704 704
                     break;
705 705
                 case err.PERMISSION_DENINED:
706
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
706
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
707 707
                     break;
708 708
                 case err.POSITION_UNAVAILABLE:
709
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
709
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
710 710
                     break;
711 711
                 case err.BREAK:
712
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
712
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
713 713
                     break;
714 714
                 default:
715
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
715
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
716 716
             }
717 717
             jQuery('#info').html(msg);
718 718
         }
@@ -751,7 +751,7 @@  discard block
 block discarded – undo
751 751
              * @param object $post The post object.
752 752
              * @param string $link The link to the post.
753 753
              */
754
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
754
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
755 755
             break;
756 756
         case 'new' :
757 757
             /**
@@ -761,7 +761,7 @@  discard block
 block discarded – undo
761 761
              * @param object $post The post object.
762 762
              * @param string $link The link to the post.
763 763
              */
764
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
764
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
765 765
             break;
766 766
 
767 767
     }
Please login to merge, or discard this patch.