Test Failed
Pull Request — master (#353)
by Kiran
59:32
created
geodirectory_template_tags.php 2 patches
Indentation   +337 added lines, -337 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,168 +35,168 @@  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();
38
+	$is_detail_page = false;
39
+	$geodir_map_name = geodir_map_name();
40 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', array(), GEODIRECTORY_VERSION);
48
-    wp_enqueue_script('geodirectory-script');
41
+	if((is_single() && geodir_is_geodir_page()) || (is_page() && geodir_is_page('preview') )) {
42
+		$is_detail_page = true;
43
+	}
49 44
 
50
-    $geodir_vars_data = array(
51
-        'siteurl' => get_option('siteurl'),
52
-        'geodir_plugin_url' => geodir_plugin_url(),
53
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
54
-        'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
-        'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
-    );
45
+	wp_enqueue_script('jquery');
46
+
47
+	wp_register_script('geodirectory-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory.min.js', 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_lazy_load' => get_option('geodir_lazy_load',1),
54
+		'geodir_ajax_url' => geodir_get_ajax_url(),
55
+		'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
56
+		'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57
+	);
58
+
59
+	/**
60
+	 * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
+	 *
62
+	 * This is used by addons to add JS translatable variables.
63
+	 *
64
+	 * @since 1.4.4
65
+	 * @param array $geodir_vars_data {
66
+	 *    geodir var data used by addons to add JS translatable variables.
67
+	 *
68
+	 *    @type string $siteurl Site url.
69
+	 *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
+	 *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
+	 *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
+	 *    @type int $is_rtl Checks if current locale is RTL.
73
+	 *
74
+	 * }
75
+	 */
76
+	$geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
+
78
+	wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
+
80
+	wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
+	if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
+
83
+	wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
+	wp_enqueue_script('geodirectory-lightbox-jquery');
85
+
86
+	wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
+	if ($is_detail_page) {
88
+		wp_enqueue_script('geodirectory-jquery-simplemodal');
89
+	}
58 90
 
59
-    /**
60
-     * Filter the `geodir_var` data array that outputs the  wp_localize_script() translations and variables.
61
-     *
62
-     * This is used by addons to add JS translatable variables.
63
-     *
64
-     * @since 1.4.4
65
-     * @param array $geodir_vars_data {
66
-     *    geodir var data used by addons to add JS translatable variables.
67
-     *
68
-     *    @type string $siteurl Site url.
69
-     *    @type string $geodir_plugin_url Geodirectory core plugin url.
70
-     *    @type string $geodir_ajax_url Geodirectory plugin ajax url.
71
-     *    @type int $geodir_gd_modal Disable GD modal that displays slideshow images in popup?.
72
-     *    @type int $is_rtl Checks if current locale is RTL.
73
-     *
74
-     * }
75
-     */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
77
-
78
-    wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79
-
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
82
-
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
84
-    wp_enqueue_script('geodirectory-lightbox-jquery');
85
-
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
87
-    if ($is_detail_page) {
88
-        wp_enqueue_script('geodirectory-jquery-simplemodal');
89
-    }
90
-
91
-    if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
94
-        /**
95
-         * Filter the variables that are added to the end of the google maps script call.
96
-         *
97
-         * This i used to change things like google maps language etc.
98
-         *
99
-         * @since 1.0.0
100
-         * @param string $var The string to filter, default is empty string.
101
-         */
102
-        $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
-    }
91
+	if (in_array($geodir_map_name, array('auto', 'google'))) {
92
+		$map_lang = "&language=" . geodir_get_map_default_language();
93
+		$map_key = "&key=" . geodir_get_map_api_key();
94
+		/**
95
+		 * Filter the variables that are added to the end of the google maps script call.
96
+		 *
97
+		 * This i used to change things like google maps language etc.
98
+		 *
99
+		 * @since 1.0.0
100
+		 * @param string $var The string to filter, default is empty string.
101
+		 */
102
+		$map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
+		wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
104
+	}
105 105
     
106
-    if ($geodir_map_name == 'osm') {
107
-        // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
-        wp_enqueue_style('geodirectory-leaflet-style');
106
+	if ($geodir_map_name == 'osm') {
107
+		// Leaflet OpenStreetMap
108
+		wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109
+		wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
-        wp_enqueue_script('geodirectory-leaflet-script');
111
+		wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112
+		wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
-        wp_enqueue_script('geodirectory-leaflet-geo-script');
114
+		wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115
+		wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117
-        if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119
-            wp_enqueue_style('geodirectory-leaflet-routing-style');
117
+		if ($is_detail_page) {
118
+			wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119
+			wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122
-            wp_enqueue_script('geodirectory-leaflet-routing-script');
123
-        }
124
-    }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
121
+			wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122
+			wp_enqueue_script('geodirectory-leaflet-routing-script');
123
+		}
124
+	}
125
+	wp_enqueue_script( 'jquery-ui-autocomplete' );
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
128
-    wp_enqueue_script('geodirectory-goMap-script');
129
-
130
-
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132
-    wp_enqueue_script('chosen');
133
-
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135
-    wp_enqueue_script('geodirectory-choose-ajax');
136
-
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138
-
139
-    if (is_page() && geodir_is_page('add-listing')) {
140
-        // SCRIPT FOR UPLOAD
141
-        wp_enqueue_script('plupload-all');
142
-        wp_enqueue_script('jquery-ui-sortable');
143
-
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
145
-        wp_enqueue_script('geodirectory-plupload-script');
146
-        // SCRIPT FOR UPLOAD END
147
-
148
-        // 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
149
-        if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
150
-            $ajax_url = admin_url('admin-ajax.php');
151
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
152
-            $ajax_url = admin_url('admin-ajax.php');
153
-        } elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
154
-            $ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
155
-        } elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
156
-            $ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
157
-        } else {
158
-            $ajax_url = admin_url('admin-ajax.php');
159
-        }
127
+	wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
128
+	wp_enqueue_script('geodirectory-goMap-script');
129
+
130
+
131
+	wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132
+	wp_enqueue_script('chosen');
133
+
134
+	wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135
+	wp_enqueue_script('geodirectory-choose-ajax');
136
+
137
+	wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138
+
139
+	if (is_page() && geodir_is_page('add-listing')) {
140
+		// SCRIPT FOR UPLOAD
141
+		wp_enqueue_script('plupload-all');
142
+		wp_enqueue_script('jquery-ui-sortable');
143
+
144
+		wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
145
+		wp_enqueue_script('geodirectory-plupload-script');
146
+		// SCRIPT FOR UPLOAD END
147
+
148
+		// 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
149
+		if (str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
150
+			$ajax_url = admin_url('admin-ajax.php');
151
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
152
+			$ajax_url = admin_url('admin-ajax.php');
153
+		} elseif (str_replace("https", "http", admin_url('admin-ajax.php')) && empty($_SERVER['HTTPS'])) {
154
+			$ajax_url = str_replace("https", "http", admin_url('admin-ajax.php'));
155
+		} elseif (!str_replace("https", "http", admin_url('admin-ajax.php')) && !empty($_SERVER['HTTPS'])) {
156
+			$ajax_url = str_replace("http", "https", admin_url('admin-ajax.php'));
157
+		} else {
158
+			$ajax_url = admin_url('admin-ajax.php');
159
+		}
160 160
 
161
-        // place js config array for plupload
162
-        $plupload_init = array(
163
-            'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
164
-            'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
165
-            'container' => 'plupload-upload-ui', // will be adjusted per uploader
166
-            'drop_element' => 'dropbox', // will be adjusted per uploader
167
-            'file_data_name' => 'async-upload', // will be adjusted per uploader
168
-            'multiple_queues' => true,
169
-            'max_file_size' => geodir_max_upload_size(),
170
-            'url' => $ajax_url,
171
-            'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
172
-            'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
173
-            'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
174
-            'multipart' => true,
175
-            'urlstream_upload' => true,
176
-            'multi_selection' => false, // will be added per uploader
177
-            // additional post data to send to our ajax hook
178
-            'multipart_params' => array(
179
-                '_ajax_nonce' => "", // will be added per uploader
180
-                'action' => 'plupload_action', // the ajax action name
181
-                'imgid' => 0 // will be added per uploader
182
-            )
183
-        );
184
-        $base_plupload_config = json_encode($plupload_init);
185
-
186
-        $gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
187
-            'upload_img_size' => geodir_max_upload_size());
188
-
189
-        wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190
-
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
192
-    } // End if for add place page
193
-
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195
-    if ($is_detail_page) {
161
+		// place js config array for plupload
162
+		$plupload_init = array(
163
+			'runtimes' => 'html5,silverlight,flash,browserplus,gears,html4',
164
+			'browse_button' => 'plupload-browse-button', // will be adjusted per uploader
165
+			'container' => 'plupload-upload-ui', // will be adjusted per uploader
166
+			'drop_element' => 'dropbox', // will be adjusted per uploader
167
+			'file_data_name' => 'async-upload', // will be adjusted per uploader
168
+			'multiple_queues' => true,
169
+			'max_file_size' => geodir_max_upload_size(),
170
+			'url' => $ajax_url,
171
+			'flash_swf_url' => includes_url('js/plupload/plupload.flash.swf'),
172
+			'silverlight_xap_url' => includes_url('js/plupload/plupload.silverlight.xap'),
173
+			'filters' => array(array('title' => __('Allowed Files', 'geodirectory'), 'extensions' => '*')),
174
+			'multipart' => true,
175
+			'urlstream_upload' => true,
176
+			'multi_selection' => false, // will be added per uploader
177
+			// additional post data to send to our ajax hook
178
+			'multipart_params' => array(
179
+				'_ajax_nonce' => "", // will be added per uploader
180
+				'action' => 'plupload_action', // the ajax action name
181
+				'imgid' => 0 // will be added per uploader
182
+			)
183
+		);
184
+		$base_plupload_config = json_encode($plupload_init);
185
+
186
+		$gd_plupload_init = array('base_plupload_config' => $base_plupload_config,
187
+			'upload_img_size' => geodir_max_upload_size());
188
+
189
+		wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190
+
191
+		wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
192
+	} // End if for add place page
193
+
194
+	wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195
+	if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199
-    // font awesome rating script
199
+	// font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201 201
 		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
@@ -205,11 +205,11 @@  discard block
 block discarded – undo
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209
-    wp_enqueue_script('geodir-on-document-load');
208
+	wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209
+	wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212
-    wp_enqueue_script('google-geometa');
211
+	wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212
+	wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
215 215
 /**
@@ -223,8 +223,8 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
227
-    echo stripslashes(get_option('geodir_header_scripts'));
226
+	echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
227
+	echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
230 230
 /**
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
  */
238 238
 function geodir_google_analytics_tracking_code()
239 239
 {
240
-    if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
240
+	if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
241 241
 
242 242
         <script>
243 243
             (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -252,9 +252,9 @@  discard block
 block discarded – undo
252 252
         </script>
253 253
 
254 254
         <?php
255
-    }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
256
-        echo stripslashes(get_option('geodir_ga_tracking_code'));
257
-    }
255
+	}elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
256
+		echo stripslashes(get_option('geodir_ga_tracking_code'));
257
+	}
258 258
 }
259 259
 
260 260
 /**
@@ -268,16 +268,16 @@  discard block
 block discarded – undo
268 268
 function geodir_footer_scripts()
269 269
 {
270 270
 
271
-    echo stripslashes(get_option('geodir_footer_scripts'));
271
+	echo stripslashes(get_option('geodir_footer_scripts'));
272 272
 
273
-    /*
273
+	/*
274 274
      * Apple suck and can't/won't fix bugs: https://bugs.webkit.org/show_bug.cgi?id=136041
275 275
      *
276 276
      * Flexbox wont wrap on ios for search form items
277 277
      */
278
-    if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
279
-        echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
280
-    }
278
+	if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
279
+		echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
280
+	}
281 281
 }
282 282
 
283 283
 
@@ -291,12 +291,12 @@  discard block
 block discarded – undo
291 291
  */
292 292
 function geodir_add_async_forscript($url)
293 293
 {
294
-    if (strpos($url, '#asyncload')===false)
295
-        return $url;
296
-    else if (is_admin())
297
-        return str_replace('#asyncload', '', $url);
298
-    else
299
-        return str_replace('#asyncload', '', $url)."' async='async";
294
+	if (strpos($url, '#asyncload')===false)
295
+		return $url;
296
+	else if (is_admin())
297
+		return str_replace('#asyncload', '', $url);
298
+	else
299
+		return str_replace('#asyncload', '', $url)."' async='async";
300 300
 }
301 301
 add_filter('clean_url', 'geodir_add_async_forscript', 11, 1);
302 302
 
@@ -309,17 +309,17 @@  discard block
 block discarded – undo
309 309
 function geodir_templates_styles()
310 310
 {
311 311
 
312
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
313
-    wp_enqueue_style('geodir-core-scss');
314
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
312
+	wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
313
+	wp_enqueue_style('geodir-core-scss');
314
+	wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
315 315
 
316
-    if(is_rtl()){
317
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
318
-    wp_enqueue_style('geodirectory-frontend-rtl-style');
319
-    }
316
+	if(is_rtl()){
317
+	wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
318
+	wp_enqueue_style('geodirectory-frontend-rtl-style');
319
+	}
320 320
 
321
-    wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
322
-    wp_enqueue_style('font-awesome');
321
+	wp_register_style('font-awesome', '//maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css', array(), GEODIRECTORY_VERSION);
322
+	wp_enqueue_style('font-awesome');
323 323
 
324 324
 
325 325
 }
@@ -333,7 +333,7 @@  discard block
 block discarded – undo
333 333
  */
334 334
 function geodir_get_sidebar()
335 335
 {
336
-    get_sidebar('geodirectory');
336
+	get_sidebar('geodirectory');
337 337
 }
338 338
 
339 339
 /**
@@ -352,122 +352,122 @@  discard block
 block discarded – undo
352 352
  * @param bool $always_show Do you want to show the pagination always? Default: false.
353 353
  */
354 354
 function geodir_pagination($before = '', $after = '', $prelabel = '', $nxtlabel = '', $pages_to_show = 5, $always_show = false) {
355
-    global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
355
+	global $wp_query, $posts_per_page, $wpdb, $paged, $blog_id;
356 356
 
357
-    if (empty($prelabel)) {
358
-        $prelabel = '<strong>&laquo;</strong>';
359
-    }
357
+	if (empty($prelabel)) {
358
+		$prelabel = '<strong>&laquo;</strong>';
359
+	}
360 360
 
361
-    if (empty($nxtlabel)) {
362
-        $nxtlabel = '<strong>&raquo;</strong>';
363
-    }
361
+	if (empty($nxtlabel)) {
362
+		$nxtlabel = '<strong>&raquo;</strong>';
363
+	}
364 364
 
365
-    $half_pages_to_show = round($pages_to_show / 2);
365
+	$half_pages_to_show = round($pages_to_show / 2);
366 366
 
367
-    if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
368
-        return;
367
+	if (geodir_is_page('home')) // dont apply default  pagination for geodirectory home page.
368
+		return;
369 369
 
370
-    if (!is_single()) {
371
-        if (function_exists('geodir_location_geo_home_link')) {
372
-            remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
373
-        }
374
-        $numposts = $wp_query->found_posts;
370
+	if (!is_single()) {
371
+		if (function_exists('geodir_location_geo_home_link')) {
372
+			remove_filter('home_url', 'geodir_location_geo_home_link', 100000);
373
+		}
374
+		$numposts = $wp_query->found_posts;
375 375
 
376
-        $max_page = ceil($numposts / $posts_per_page);
376
+		$max_page = ceil($numposts / $posts_per_page);
377 377
 
378
-        if (empty($paged)) {
379
-            $paged = 1;
380
-        }
378
+		if (empty($paged)) {
379
+			$paged = 1;
380
+		}
381 381
         
382
-        $post_type = geodir_get_current_posttype();
383
-        $listing_type_name = get_post_type_plural_label($post_type);
384
-        if (geodir_is_page('listing') || geodir_is_page('search')) {            
385
-            $term = array();
382
+		$post_type = geodir_get_current_posttype();
383
+		$listing_type_name = get_post_type_plural_label($post_type);
384
+		if (geodir_is_page('listing') || geodir_is_page('search')) {            
385
+			$term = array();
386 386
             
387
-            if (is_tax()) {
388
-                $term_id = get_queried_object_id();
389
-                $taxonomy = get_query_var('taxonomy');
387
+			if (is_tax()) {
388
+				$term_id = get_queried_object_id();
389
+				$taxonomy = get_query_var('taxonomy');
390 390
 
391
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
392
-                    $term = get_term($term_id, $post_type . 'category');
393
-                }
394
-            }
391
+				if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
392
+					$term = get_term($term_id, $post_type . 'category');
393
+				}
394
+			}
395 395
             
396
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
397
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
396
+			if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
397
+				$taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
398 398
                 
399
-                if (!is_array($taxonomy_search)) {
400
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
401
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
402
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
403
-                }
404
-            }
399
+				if (!is_array($taxonomy_search)) {
400
+					$term = get_term((int)$taxonomy_search, $post_type . 'category');
401
+				} else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
402
+					$term = get_term((int)$taxonomy_search[0], $post_type . 'category');
403
+				}
404
+			}
405 405
             
406
-            if (!empty($term) && !is_wp_error($term)) {
407
-                $listing_type_name = $term->name;
408
-            }
409
-        }
406
+			if (!empty($term) && !is_wp_error($term)) {
407
+				$listing_type_name = $term->name;
408
+			}
409
+		}
410 410
 
411
-        if ($max_page > 1 || $always_show) {            
412
-            // Extra pagination info
413
-            $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
414
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
415
-            $end_no = min($paged * $posts_per_page, $numposts);
411
+		if ($max_page > 1 || $always_show) {            
412
+			// Extra pagination info
413
+			$geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
414
+			$start_no = ( $paged - 1 ) * $posts_per_page + 1;
415
+			$end_no = min($paged * $posts_per_page, $numposts);
416 416
 
417
-            if ($geodir_pagination_more_info != '') {
418
-                if ($listing_type_name) {
419
-                    $listing_type_name = __($listing_type_name, 'geodirectory');
420
-                    $pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
421
-                } else {
422
-                    $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
423
-                }
424
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
425
-                /**
426
-                 * Adds an extra pagination info above/under pagination.
427
-                 *
428
-                 * @since 1.5.9
429
-                 *
430
-                 * @param string $pagination_info Extra pagination info content.
431
-                 * @param string $listing_type_name Listing results type.
432
-                 * @param string $start_no First result number.
433
-                 * @param string $end_no Last result number.
434
-                 * @param string $numposts Total number of listings.
435
-                 * @param string $post_type The post type.
436
-                 */
437
-                $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
417
+			if ($geodir_pagination_more_info != '') {
418
+				if ($listing_type_name) {
419
+					$listing_type_name = __($listing_type_name, 'geodirectory');
420
+					$pegination_desc = wp_sprintf(__('Showing %s %d-%d of %d', 'geodirectory'), $listing_type_name, $start_no, $end_no, $numposts);
421
+				} else {
422
+					$pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
423
+				}
424
+				$pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
425
+				/**
426
+				 * Adds an extra pagination info above/under pagination.
427
+				 *
428
+				 * @since 1.5.9
429
+				 *
430
+				 * @param string $pagination_info Extra pagination info content.
431
+				 * @param string $listing_type_name Listing results type.
432
+				 * @param string $start_no First result number.
433
+				 * @param string $end_no Last result number.
434
+				 * @param string $numposts Total number of listings.
435
+				 * @param string $post_type The post type.
436
+				 */
437
+				$pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
438 438
                 
439
-                if ($geodir_pagination_more_info == 'before') {
440
-                    $before = $before . $pagination_info;
441
-                } else if ($geodir_pagination_more_info == 'after') {
442
-                    $after = $pagination_info . $after;
443
-                }
444
-            }
439
+				if ($geodir_pagination_more_info == 'before') {
440
+					$before = $before . $pagination_info;
441
+				} else if ($geodir_pagination_more_info == 'after') {
442
+					$after = $pagination_info . $after;
443
+				}
444
+			}
445 445
             
446
-            echo "$before <div class='Navi gd-navi'>";
447
-            if ($paged >= ($pages_to_show - 1)) {
448
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
449
-            }
450
-            previous_posts_link($prelabel);
451
-            for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
452
-                if ($i >= 1 && $i <= $max_page) {
453
-                    if ($i == $paged) {
454
-                        echo "<strong class='on'>$i</strong>";
455
-                    } else {
456
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
457
-                    }
458
-                }
459
-            }
460
-            next_posts_link($nxtlabel, $max_page);
461
-            if (($paged + $half_pages_to_show) < ($max_page)) {
462
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
463
-            }
464
-            echo "</div> $after";
465
-        }
446
+			echo "$before <div class='Navi gd-navi'>";
447
+			if ($paged >= ($pages_to_show - 1)) {
448
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
449
+			}
450
+			previous_posts_link($prelabel);
451
+			for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
452
+				if ($i >= 1 && $i <= $max_page) {
453
+					if ($i == $paged) {
454
+						echo "<strong class='on'>$i</strong>";
455
+					} else {
456
+						echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
457
+					}
458
+				}
459
+			}
460
+			next_posts_link($nxtlabel, $max_page);
461
+			if (($paged + $half_pages_to_show) < ($max_page)) {
462
+				echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
463
+			}
464
+			echo "</div> $after";
465
+		}
466 466
         
467
-        if (function_exists('geodir_location_geo_home_link')) {
468
-            add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
469
-        }
470
-    }
467
+		if (function_exists('geodir_location_geo_home_link')) {
468
+			add_filter('home_url', 'geodir_location_geo_home_link', 100000, 2);
469
+		}
470
+	}
471 471
 }
472 472
 
473 473
 /**
@@ -478,20 +478,20 @@  discard block
 block discarded – undo
478 478
  */
479 479
 function geodir_listingsearch_scripts()
480 480
 {
481
-    if (get_option('gd_search_dist') != '') {
482
-        $dist = get_option('gd_search_dist');
483
-    } else {
484
-        $dist = 500;
485
-    }
486
-    $dist_dif = 1000;
487
-
488
-    if ($dist <= 5000) $dist_dif = 500;
489
-    if ($dist <= 1000) $dist_dif = 100;
490
-    if ($dist <= 500) $dist_dif = 50;
491
-    if ($dist <= 100) $dist_dif = 10;
492
-    if ($dist <= 50) $dist_dif = 5;
493
-
494
-    ?>
481
+	if (get_option('gd_search_dist') != '') {
482
+		$dist = get_option('gd_search_dist');
483
+	} else {
484
+		$dist = 500;
485
+	}
486
+	$dist_dif = 1000;
487
+
488
+	if ($dist <= 5000) $dist_dif = 500;
489
+	if ($dist <= 1000) $dist_dif = 100;
490
+	if ($dist <= 500) $dist_dif = 50;
491
+	if ($dist <= 100) $dist_dif = 10;
492
+	if ($dist <= 50) $dist_dif = 5;
493
+
494
+	?>
495 495
     <script type="text/javascript">
496 496
 
497 497
         jQuery(function ($) {
@@ -549,20 +549,20 @@  discard block
 block discarded – undo
549 549
  * @package GeoDirectory
550 550
  */
551 551
 function geodir_add_sharelocation_scripts() {
552
-    $default_search_for_text = SEARCH_FOR_TEXT;
553
-    if (get_option('geodir_search_field_default_text'))
554
-        $default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
552
+	$default_search_for_text = SEARCH_FOR_TEXT;
553
+	if (get_option('geodir_search_field_default_text'))
554
+		$default_search_for_text = __(get_option('geodir_search_field_default_text'), 'geodirectory');
555 555
 
556
-    $default_near_text = NEAR_TEXT;
557
-    if (get_option('geodir_near_field_default_text'))
558
-        $default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
556
+	$default_near_text = NEAR_TEXT;
557
+	if (get_option('geodir_near_field_default_text'))
558
+		$default_near_text = __(get_option('geodir_near_field_default_text'), 'geodirectory');
559 559
     
560
-    $search_location = geodir_get_default_location();
560
+	$search_location = geodir_get_default_location();
561 561
     
562
-    $default_search_for_text = addslashes(stripslashes($default_search_for_text));
563
-    $default_near_text = addslashes(stripslashes($default_near_text));
564
-    $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
565
-    ?>
562
+	$default_search_for_text = addslashes(stripslashes($default_search_for_text));
563
+	$default_near_text = addslashes(stripslashes($default_near_text));
564
+	$city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
565
+	?>
566 566
     <script type="text/javascript">
567 567
         var default_location = '<?php echo $city ;?>';
568 568
         var latlng;
@@ -643,14 +643,14 @@  discard block
 block discarded – undo
643 643
                     initialise2();
644 644
                 } else {
645 645
                     <?php
646
-                    $near_add = get_option('geodir_search_near_addition');
647
-                    /**
648
-                     * Adds any extra info to the near search box query when trying to geolocate it via google api.
649
-                     *
650
-                     * @since 1.0.0
651
-                     */
652
-                    $near_add2 = apply_filters('geodir_search_near_addition', '');
653
-                    ?>
646
+					$near_add = get_option('geodir_search_near_addition');
647
+					/**
648
+					 * Adds any extra info to the near search box query when trying to geolocate it via google api.
649
+					 *
650
+					 * @since 1.0.0
651
+					 */
652
+					$near_add2 = apply_filters('geodir_search_near_addition', '');
653
+					?>
654 654
                     if (window.gdMaps === 'google') {
655 655
                         Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
656 656
                             function (results, status) {
@@ -753,30 +753,30 @@  discard block
 block discarded – undo
753 753
  */
754 754
 function geodir_show_badges_on_image($which, $post, $link)
755 755
 {
756
-    $return = '';
757
-    switch ($which) {
758
-        case 'featured':
759
-            /**
760
-             * Filter the featured image badge html that appears in the listings pages over the thumbnail.
761
-             *
762
-             * @since 1.0.0
763
-             * @param object $post The post object.
764
-             * @param string $link The link to the post.
765
-             */
766
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
767
-            break;
768
-        case 'new' :
769
-            /**
770
-             * Filter the new image badge html that appears in the listings pages over the thumbnail.
771
-             *
772
-             * @since 1.0.0
773
-             * @param object $post The post object.
774
-             * @param string $link The link to the post.
775
-             */
776
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
777
-            break;
778
-
779
-    }
756
+	$return = '';
757
+	switch ($which) {
758
+		case 'featured':
759
+			/**
760
+			 * Filter the featured image badge html that appears in the listings pages over the thumbnail.
761
+			 *
762
+			 * @since 1.0.0
763
+			 * @param object $post The post object.
764
+			 * @param string $link The link to the post.
765
+			 */
766
+			$return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
767
+			break;
768
+		case 'new' :
769
+			/**
770
+			 * Filter the new image badge html that appears in the listings pages over the thumbnail.
771
+			 *
772
+			 * @since 1.0.0
773
+			 * @param object $post The post object.
774
+			 * @param string $link The link to the post.
775
+			 */
776
+			$return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
777
+			break;
778
+
779
+	}
780 780
     
781
-    return $return;
781
+	return $return;
782 782
 }
Please login to merge, or discard this patch.
Spacing   +72 added lines, -72 removed lines patch added patch discarded remove patch
@@ -38,21 +38,21 @@  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', array(), GEODIRECTORY_VERSION);
47
+    wp_register_script('geodirectory-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory.min.js', 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
-        'geodir_lazy_load' => get_option('geodir_lazy_load',1),
53
+        'geodir_lazy_load' => get_option('geodir_lazy_load', 1),
54 54
         'geodir_ajax_url' => geodir_get_ajax_url(),
55
-        'geodir_gd_modal' => (int)get_option('geodir_disable_gb_modal'),
55
+        'geodir_gd_modal' => (int) get_option('geodir_disable_gb_modal'),
56 56
         'is_rtl' => is_rtl() ? 1 : 0 // fix rtl issue
57 57
     );
58 58
 
@@ -73,24 +73,24 @@  discard block
 block discarded – undo
73 73
      *
74 74
      * }
75 75
      */
76
-    $geodir_vars_data = apply_filters('geodir_vars_data',$geodir_vars_data);
76
+    $geodir_vars_data = apply_filters('geodir_vars_data', $geodir_vars_data);
77 77
 
78 78
     wp_localize_script('geodirectory-script', 'geodir_var', $geodir_vars_data);
79 79
 
80
-    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION,true);
81
-    if($is_detail_page){wp_enqueue_script('geodirectory-jquery-flexslider-js');}
80
+    wp_register_script('geodirectory-jquery-flexslider-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.flexslider.min.js', array(), GEODIRECTORY_VERSION, true);
81
+    if ($is_detail_page) {wp_enqueue_script('geodirectory-jquery-flexslider-js'); }
82 82
 
83
-    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url() . '/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION,true);
83
+    wp_register_script('geodirectory-lightbox-jquery', geodir_plugin_url().'/geodirectory-assets/js/jquery.lightbox-0.5.min.js', array(), GEODIRECTORY_VERSION, true);
84 84
     wp_enqueue_script('geodirectory-lightbox-jquery');
85 85
 
86
-    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url() . '/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION,true);
86
+    wp_register_script('geodirectory-jquery-simplemodal', geodir_plugin_url().'/geodirectory-assets/js/jquery.simplemodal.min.js', array(), GEODIRECTORY_VERSION, true);
87 87
     if ($is_detail_page) {
88 88
         wp_enqueue_script('geodirectory-jquery-simplemodal');
89 89
     }
90 90
 
91 91
     if (in_array($geodir_map_name, array('auto', 'google'))) {
92
-        $map_lang = "&language=" . geodir_get_map_default_language();
93
-        $map_key = "&key=" . geodir_get_map_api_key();
92
+        $map_lang = "&language=".geodir_get_map_default_language();
93
+        $map_key = "&key=".geodir_get_map_api_key();
94 94
         /**
95 95
          * Filter the variables that are added to the end of the google maps script call.
96 96
          *
@@ -100,48 +100,48 @@  discard block
 block discarded – undo
100 100
          * @param string $var The string to filter, default is empty string.
101 101
          */
102 102
         $map_extra = apply_filters('geodir_googlemap_script_extra', '');
103
-        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?' . $map_lang . $map_key . $map_extra , '', NULL);
103
+        wp_enqueue_script('geodirectory-googlemap-script', 'https://maps.google.com/maps/api/js?'.$map_lang.$map_key.$map_extra, '', NULL);
104 104
     }
105 105
     
106 106
     if ($geodir_map_name == 'osm') {
107 107
         // Leaflet OpenStreetMap
108
-        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
108
+        wp_register_style('geodirectory-leaflet-style', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.css', array(), GEODIRECTORY_VERSION);
109 109
         wp_enqueue_style('geodirectory-leaflet-style');
110 110
             
111
-        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
111
+        wp_register_script('geodirectory-leaflet-script', geodir_plugin_url().'/geodirectory-assets/leaflet/leaflet.min.js', array(), GEODIRECTORY_VERSION);
112 112
         wp_enqueue_script('geodirectory-leaflet-script');
113 113
         
114
-        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
114
+        wp_register_script('geodirectory-leaflet-geo-script', geodir_plugin_url().'/geodirectory-assets/leaflet/osm.geocode.js', array(), GEODIRECTORY_VERSION);
115 115
         wp_enqueue_script('geodirectory-leaflet-geo-script');
116 116
         
117 117
         if ($is_detail_page) {
118
-            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
118
+            wp_register_style('geodirectory-leaflet-routing-style', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.css', array(), GEODIRECTORY_VERSION);
119 119
             wp_enqueue_style('geodirectory-leaflet-routing-style');
120 120
                 
121
-            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url() . '/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
121
+            wp_register_script('geodirectory-leaflet-routing-script', geodir_plugin_url().'/geodirectory-assets/leaflet/routing/leaflet-routing-machine.js', array(), GEODIRECTORY_VERSION);
122 122
             wp_enqueue_script('geodirectory-leaflet-routing-script');
123 123
         }
124 124
     }
125
-    wp_enqueue_script( 'jquery-ui-autocomplete' );
125
+    wp_enqueue_script('jquery-ui-autocomplete');
126 126
     
127
-    wp_register_script('geodirectory-goMap-script', geodir_plugin_url() . '/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION,true);
127
+    wp_register_script('geodirectory-goMap-script', geodir_plugin_url().'/geodirectory-assets/js/goMap.min.js', array(), GEODIRECTORY_VERSION, true);
128 128
     wp_enqueue_script('geodirectory-goMap-script');
129 129
 
130 130
 
131
-    wp_register_script('chosen', geodir_plugin_url() . '/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
131
+    wp_register_script('chosen', geodir_plugin_url().'/geodirectory-assets/js/chosen.jquery.min.js', array(), GEODIRECTORY_VERSION);
132 132
     wp_enqueue_script('chosen');
133 133
 
134
-    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url() . '/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
134
+    wp_register_script('geodirectory-choose-ajax', geodir_plugin_url().'/geodirectory-assets/js/ajax-chosen.min.js', array(), GEODIRECTORY_VERSION);
135 135
     wp_enqueue_script('geodirectory-choose-ajax');
136 136
 
137
-    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
137
+    wp_enqueue_script('geodirectory-jquery-ui-timepicker-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.ui.timepicker.min.js', array('jquery-ui-datepicker', 'jquery-ui-slider', 'jquery-effects-core', 'jquery-effects-slide'), '', true);
138 138
 
139 139
     if (is_page() && geodir_is_page('add-listing')) {
140 140
         // SCRIPT FOR UPLOAD
141 141
         wp_enqueue_script('plupload-all');
142 142
         wp_enqueue_script('jquery-ui-sortable');
143 143
 
144
-        wp_register_script('geodirectory-plupload-script', geodir_plugin_url() . '/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION,true);
144
+        wp_register_script('geodirectory-plupload-script', geodir_plugin_url().'/geodirectory-assets/js/geodirectory-plupload.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
145 145
         wp_enqueue_script('geodirectory-plupload-script');
146 146
         // SCRIPT FOR UPLOAD END
147 147
 
@@ -188,27 +188,27 @@  discard block
 block discarded – undo
188 188
 
189 189
         wp_localize_script('geodirectory-plupload-script', 'gd_plupload', $gd_plupload_init);
190 190
 
191
-        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url() . '/geodirectory-assets/js/listing_validation.min.js#asyncload');
191
+        wp_enqueue_script('geodirectory-listing-validation-script', geodir_plugin_url().'/geodirectory-assets/js/listing_validation.min.js#asyncload');
192 192
     } // End if for add place page
193 193
 
194
-    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url() . '/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
194
+    wp_register_script('geodirectory-post-custom-js', geodir_plugin_url().'/geodirectory-assets/js/post.custom.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
195 195
     if ($is_detail_page) {
196 196
 		wp_enqueue_script('geodirectory-post-custom-js');
197 197
 	}
198 198
 
199 199
     // font awesome rating script
200 200
 	if (get_option('geodir_reviewrating_enable_font_awesome')) {
201
-		wp_register_script('geodir-barrating-js', geodir_plugin_url() . '/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
201
+		wp_register_script('geodir-barrating-js', geodir_plugin_url().'/geodirectory-assets/js/jquery.barrating.min.js', array(), GEODIRECTORY_VERSION, true);
202 202
 		wp_enqueue_script('geodir-barrating-js');
203 203
 	} else { // default rating script
204
-		wp_register_script('geodir-jRating-js', geodir_plugin_url() . '/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
204
+		wp_register_script('geodir-jRating-js', geodir_plugin_url().'/geodirectory-assets/js/jRating.jquery.min.js', array(), GEODIRECTORY_VERSION, true);
205 205
 		wp_enqueue_script('geodir-jRating-js');
206 206
 	}
207 207
 
208
-    wp_register_script('geodir-on-document-load', geodir_plugin_url() . '/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
208
+    wp_register_script('geodir-on-document-load', geodir_plugin_url().'/geodirectory-assets/js/on_document_load.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
209 209
     wp_enqueue_script('geodir-on-document-load');
210 210
 
211
-    wp_register_script('google-geometa', geodir_plugin_url() . '/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
211
+    wp_register_script('google-geometa', geodir_plugin_url().'/geodirectory-assets/js/geometa.min.js#asyncload', array(), GEODIRECTORY_VERSION, true);
212 212
     wp_enqueue_script('google-geometa');
213 213
 }
214 214
 
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
  */
224 224
 function geodir_header_scripts()
225 225
 {
226
-    echo '<style>' . stripslashes(get_option('geodir_coustem_css')) . '</style>';
226
+    echo '<style>'.stripslashes(get_option('geodir_coustem_css')).'</style>';
227 227
     echo stripslashes(get_option('geodir_header_scripts'));
228 228
 }
229 229
 
@@ -237,7 +237,7 @@  discard block
 block discarded – undo
237 237
  */
238 238
 function geodir_google_analytics_tracking_code()
239 239
 {
240
-    if(get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')){?>
240
+    if (get_option('geodir_ga_add_tracking_code') && get_option('geodir_ga_account_id')) {?>
241 241
 
242 242
         <script>
243 243
             (function(i,s,o,g,r,a,m){ i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
@@ -245,14 +245,14 @@  discard block
 block discarded – undo
245 245
                 m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
246 246
             })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
247 247
 
248
-            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id'));?>', 'auto');
249
-            <?php if(get_option('geodir_ga_anonymize_ip')){echo "ga('set', 'anonymizeIP', true);";}?>
248
+            ga('create', '<?php echo esc_attr(get_option('geodir_ga_account_id')); ?>', 'auto');
249
+            <?php if (get_option('geodir_ga_anonymize_ip')) {echo "ga('set', 'anonymizeIP', true);"; }?>
250 250
             ga('send', 'pageview');
251 251
 
252 252
         </script>
253 253
 
254 254
         <?php
255
-    }elseif(get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')){
255
+    }elseif (get_option('geodir_ga_tracking_code') && !get_option('geodir_ga_account_id')) {
256 256
         echo stripslashes(get_option('geodir_ga_tracking_code'));
257 257
     }
258 258
 }
@@ -275,7 +275,7 @@  discard block
 block discarded – undo
275 275
      *
276 276
      * Flexbox wont wrap on ios for search form items
277 277
      */
278
-    if ( !empty( $_SERVER['HTTP_USER_AGENT'] ) && preg_match( '/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'] ) ) {
278
+    if (!empty($_SERVER['HTTP_USER_AGENT']) && preg_match('/iPad|iPod|iPhone|Safari/', $_SERVER['HTTP_USER_AGENT'])) {
279 279
         echo "<style>body .geodir-listing-search.gd-search-bar-style .geodir-loc-bar .clearfix.geodir-loc-bar-in .geodir-search .gd-search-input-wrapper{flex:50 1 auto !important;min-width: initial !important;width:auto !important;}.geodir-filter-container .geodir-filter-cat{width:auto !important;}</style>";
280 280
     }
281 281
 }
@@ -291,7 +291,7 @@  discard block
 block discarded – undo
291 291
  */
292 292
 function geodir_add_async_forscript($url)
293 293
 {
294
-    if (strpos($url, '#asyncload')===false)
294
+    if (strpos($url, '#asyncload') === false)
295 295
         return $url;
296 296
     else if (is_admin())
297 297
         return str_replace('#asyncload', '', $url);
@@ -309,12 +309,12 @@  discard block
 block discarded – undo
309 309
 function geodir_templates_styles()
310 310
 {
311 311
 
312
-    wp_register_style('geodir-core-scss', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
312
+    wp_register_style('geodir-core-scss', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend.css', array(), GEODIRECTORY_VERSION);
313 313
     wp_enqueue_style('geodir-core-scss');
314
-    wp_register_style('geodir-core-scss-footer', geodir_plugin_url() . '/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
314
+    wp_register_style('geodir-core-scss-footer', geodir_plugin_url().'/geodirectory-assets/css/gd_core_frontend_footer.css', array(), GEODIRECTORY_VERSION);
315 315
 
316
-    if(is_rtl()){
317
-    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url() . '/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
316
+    if (is_rtl()) {
317
+    wp_register_style('geodirectory-frontend-rtl-style', geodir_plugin_url().'/geodirectory-assets/css/rtl-frontend.css', array(), GEODIRECTORY_VERSION);
318 318
     wp_enqueue_style('geodirectory-frontend-rtl-style');
319 319
     }
320 320
 
@@ -388,18 +388,18 @@  discard block
 block discarded – undo
388 388
                 $term_id = get_queried_object_id();
389 389
                 $taxonomy = get_query_var('taxonomy');
390 390
 
391
-                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type . 'category' ) {
392
-                    $term = get_term($term_id, $post_type . 'category');
391
+                if ($term_id && $post_type && get_query_var('taxonomy') == $post_type.'category') {
392
+                    $term = get_term($term_id, $post_type.'category');
393 393
                 }
394 394
             }
395 395
             
396
-            if (geodir_is_page('search') && !empty($_REQUEST['s' . $post_type . 'category'])) {
397
-                $taxonomy_search = $_REQUEST['s' . $post_type . 'category'];
396
+            if (geodir_is_page('search') && !empty($_REQUEST['s'.$post_type.'category'])) {
397
+                $taxonomy_search = $_REQUEST['s'.$post_type.'category'];
398 398
                 
399 399
                 if (!is_array($taxonomy_search)) {
400
-                    $term = get_term((int)$taxonomy_search, $post_type . 'category');
401
-                } else if(is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
402
-                    $term = get_term((int)$taxonomy_search[0], $post_type . 'category');
400
+                    $term = get_term((int) $taxonomy_search, $post_type.'category');
401
+                } else if (is_array($taxonomy_search) && count($taxonomy_search) == 1) { // single category search
402
+                    $term = get_term((int) $taxonomy_search[0], $post_type.'category');
403 403
                 }
404 404
             }
405 405
             
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
         if ($max_page > 1 || $always_show) {            
412 412
             // Extra pagination info
413 413
             $geodir_pagination_more_info = get_option('geodir_pagination_advance_info');
414
-            $start_no = ( $paged - 1 ) * $posts_per_page + 1;
414
+            $start_no = ($paged - 1) * $posts_per_page + 1;
415 415
             $end_no = min($paged * $posts_per_page, $numposts);
416 416
 
417 417
             if ($geodir_pagination_more_info != '') {
@@ -421,7 +421,7 @@  discard block
 block discarded – undo
421 421
                 } else {
422 422
                     $pegination_desc = wp_sprintf(__('Showing listings %d-%d of %d', 'geodirectory'), $start_no, $end_no, $numposts);
423 423
                 }
424
-                $pagination_info = '<div class="gd-pagination-details">' . $pegination_desc . '</div>';
424
+                $pagination_info = '<div class="gd-pagination-details">'.$pegination_desc.'</div>';
425 425
                 /**
426 426
                  * Adds an extra pagination info above/under pagination.
427 427
                  *
@@ -437,15 +437,15 @@  discard block
 block discarded – undo
437 437
                 $pagination_info = apply_filters('geodir_pagination_advance_info', $pagination_info, $listing_type_name, $start_no, $end_no, $numposts, $post_type);
438 438
                 
439 439
                 if ($geodir_pagination_more_info == 'before') {
440
-                    $before = $before . $pagination_info;
440
+                    $before = $before.$pagination_info;
441 441
                 } else if ($geodir_pagination_more_info == 'after') {
442
-                    $after = $pagination_info . $after;
442
+                    $after = $pagination_info.$after;
443 443
                 }
444 444
             }
445 445
             
446 446
             echo "$before <div class='Navi gd-navi'>";
447 447
             if ($paged >= ($pages_to_show - 1)) {
448
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link()) . '">&laquo;</a>';
448
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link()).'">&laquo;</a>';
449 449
             }
450 450
             previous_posts_link($prelabel);
451 451
             for ($i = $paged - $half_pages_to_show; $i <= $paged + $half_pages_to_show; $i++) {
@@ -453,13 +453,13 @@  discard block
 block discarded – undo
453 453
                     if ($i == $paged) {
454 454
                         echo "<strong class='on'>$i</strong>";
455 455
                     } else {
456
-                        echo ' <a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($i)) . '">' . $i . '</a> ';
456
+                        echo ' <a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($i)).'">'.$i.'</a> ';
457 457
                     }
458 458
                 }
459 459
             }
460 460
             next_posts_link($nxtlabel, $max_page);
461 461
             if (($paged + $half_pages_to_show) < ($max_page)) {
462
-                echo '<a href="' . str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)) . '">&raquo;</a>';
462
+                echo '<a href="'.str_replace('&paged', '&amp;paged', get_pagenum_link($max_page)).'">&raquo;</a>';
463 463
             }
464 464
             echo "</div> $after";
465 465
         }
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
         jQuery(function ($) {
498 498
             $("#distance_slider").slider({
499 499
                 range: true,
500
-                values: [0, <?php echo ($_REQUEST['sdist']!='') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
500
+                values: [0, <?php echo ($_REQUEST['sdist'] != '') ? sanitize_text_field($_REQUEST['sdist']) : "0"; ?>],
501 501
                 min: 0,
502 502
                 max: <?php echo $dist; ?>,
503 503
                 step: <?php echo $dist_dif; ?>,
@@ -564,7 +564,7 @@  discard block
 block discarded – undo
564 564
     $city = !empty($search_location) ? addslashes(stripslashes($search_location->city)) : '';
565 565
     ?>
566 566
     <script type="text/javascript">
567
-        var default_location = '<?php echo $city ;?>';
567
+        var default_location = '<?php echo $city; ?>';
568 568
         var latlng;
569 569
         var address;
570 570
         var dist = 0;
@@ -580,7 +580,7 @@  discard block
 block discarded – undo
580 580
 				var $form = jQuery(this).closest('form');
581 581
 
582 582
 				if (jQuery("#sdist input[type='radio']:checked").length != 0) dist = jQuery("#sdist input[type='radio']:checked").val();
583
-				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text;?>') jQuery('.search_text', $form).val(s);
583
+				if (jQuery('.search_text', $form).val() == '' || jQuery('.search_text', $form).val() == '<?php echo $default_search_for_text; ?>') jQuery('.search_text', $form).val(s);
584 584
 				
585 585
 				// Disable location based search for disabled location post type.
586 586
 				if (jQuery('.search_by_post', $form).val() != '' && typeof gd_cpt_no_location == 'function') {
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 					}
595 595
 				}
596 596
 				
597
-				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;?>')) {
597
+				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; ?>')) {
598 598
 					geodir_setsearch($form);
599 599
 				} else {
600 600
 					jQuery(".snear", $form).val('');
@@ -612,7 +612,7 @@  discard block
 block discarded – undo
612 612
         });
613 613
         
614 614
 		function geodir_setsearch($form) {
615
-			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);
615
+			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);
616 616
 			geocodeAddress($form);
617 617
 		}
618 618
 
@@ -631,15 +631,15 @@  discard block
 block discarded – undo
631 631
             // Call the geocode function
632 632
             Sgeocoder = window.gdMaps == 'google' ? new google.maps.Geocoder() : null;
633 633
 
634
-            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
635
-                if (jQuery('.snear', $form).val().match("^<?php _e('In:','geodirectory');?>")) {
634
+            if (jQuery('.snear', $form).val() == '' || ( jQuery('.sgeo_lat').val() != '' && jQuery('.sgeo_lon').val() != ''  ) || jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
635
+                if (jQuery('.snear', $form).val().match("^<?php _e('In:', 'geodirectory'); ?>")) {
636 636
                     jQuery(".snear", $form).val('');
637 637
                 }
638 638
                 jQuery($form).submit();
639 639
             } else {
640 640
                 var address = jQuery(".snear", $form).val();
641 641
 
642
-                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text;?>') {
642
+                if (jQuery('.snear', $form).val() == '<?php echo $default_near_text; ?>') {
643 643
                     initialise2();
644 644
                 } else {
645 645
                     <?php
@@ -652,12 +652,12 @@  discard block
 block discarded – undo
652 652
                     $near_add2 = apply_filters('geodir_search_near_addition', '');
653 653
                     ?>
654 654
                     if (window.gdMaps === 'google') {
655
-                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", ' . $near_add . '"' : '') . $near_add2;?>},
655
+                        Sgeocoder.geocode({'address': address<?php echo ($near_add ? '+", '.$near_add.'"' : '').$near_add2; ?>},
656 656
                             function (results, status) {
657 657
                                 if (status == google.maps.GeocoderStatus.OK) {
658 658
                                     updateSearchPosition(results[0].geometry.location, $form);
659 659
                                 } else {
660
-                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory');?>" + status);
660
+                                    alert("<?php esc_attr_e('Search was not successful for the following reason :', 'geodirectory'); ?>" + status);
661 661
                                 }
662 662
                             });
663 663
                     } else if (window.gdMaps === 'osm') {
@@ -666,7 +666,7 @@  discard block
 block discarded – undo
666 666
                                 if (typeof geo !== 'undefined' && geo.lat && geo.lon) {
667 667
                                     updateSearchPosition(geo, $form);
668 668
                                 } else {
669
-                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory');?>");
669
+                                    alert("<?php esc_attr_e('Search was not successful for the requested address.', 'geodirectory'); ?>");
670 670
                                 }
671 671
                             });
672 672
                     } else {
@@ -712,19 +712,19 @@  discard block
 block discarded – undo
712 712
             var msg;
713 713
             switch (err.code) {
714 714
                 case err.UNKNOWN_ERROR:
715
-                    msg = "<?php _e('Unable to find your location','geodirectory');?>";
715
+                    msg = "<?php _e('Unable to find your location', 'geodirectory'); ?>";
716 716
                     break;
717 717
                 case err.PERMISSION_DENINED:
718
-                    msg = "<?php _e('Permission denied in finding your location','geodirectory');?>";
718
+                    msg = "<?php _e('Permission denied in finding your location', 'geodirectory'); ?>";
719 719
                     break;
720 720
                 case err.POSITION_UNAVAILABLE:
721
-                    msg = "<?php _e('Your location is currently unknown','geodirectory');?>";
721
+                    msg = "<?php _e('Your location is currently unknown', 'geodirectory'); ?>";
722 722
                     break;
723 723
                 case err.BREAK:
724
-                    msg = "<?php _e('Attempt to find location took too long','geodirectory');?>";
724
+                    msg = "<?php _e('Attempt to find location took too long', 'geodirectory'); ?>";
725 725
                     break;
726 726
                 default:
727
-                    msg = "<?php _e('Location detection not supported in browser','geodirectory');?>";
727
+                    msg = "<?php _e('Location detection not supported in browser', 'geodirectory'); ?>";
728 728
             }
729 729
             jQuery('#info').html(msg);
730 730
         }
@@ -763,7 +763,7 @@  discard block
 block discarded – undo
763 763
              * @param object $post The post object.
764 764
              * @param string $link The link to the post.
765 765
              */
766
-            $return = apply_filters('geodir_featured_badge_on_image', '<a href="' . $link . '"><span class="geodir_featured_img">&nbsp;</span></a>',$post,$link);
766
+            $return = apply_filters('geodir_featured_badge_on_image', '<a href="'.$link.'"><span class="geodir_featured_img">&nbsp;</span></a>', $post, $link);
767 767
             break;
768 768
         case 'new' :
769 769
             /**
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
              * @param object $post The post object.
774 774
              * @param string $link The link to the post.
775 775
              */
776
-            $return = apply_filters('geodir_new_badge_on_image', '<a href="' . $link . '"><span class="geodir_new_listing">&nbsp;</span></a>',$post,$link);
776
+            $return = apply_filters('geodir_new_badge_on_image', '<a href="'.$link.'"><span class="geodir_new_listing">&nbsp;</span></a>', $post, $link);
777 777
             break;
778 778
 
779 779
     }
Please login to merge, or discard this patch.